1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
 
namespace DAL
{
    public class ClsIF_ProcPrice_Ctl : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 用于 替换子项目
        public string HOldNumber;
        public List<Model.ClsIF_ProcPrice_Model> DetailColl = new List<Model.ClsIF_ProcPrice_Model>();
 
 
        //根据物料和工序返回工价   //
        public double LoadProcPrice(Int64 sMaterID, Int64 sProcID, Int64 sWorkCenterID)
        {
            double sPrice = 0;
            try
            {
                //查询主表
                DataSet DsSub = new DataSet();
                DsSub = oCn.RunProcReturn("Select top 1 * from h_v_IF_ProcPrice Where  HMaterID=" + sMaterID.ToString() + " and HProcID=" + sProcID.ToString() + " and HWorkCenterID=" + sWorkCenterID.ToString(), "h_v_IF_ProcPrice");
                if (DsSub == null || DsSub.Tables[0].Rows.Count == 0)
                {
                    return 0;
                }
 
                sPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[0]["HPrice"]);
 
                return sPrice;
            }
            catch (Exception e)
            {
                return 0;
            }
        }
 
        //构造函数
        public ClsIF_ProcPrice_Ctl()
        {
            MvarItemKey = "IF_ProcPrice";
            MvarReportTitle = "工序工价资料";
        }
    }
}