コード例 #1
0
ファイル: C_KP_Rule.cs プロジェクト: maoyongjun/cloudMESTJ
        public C_KP_Rule GetKPRule(OleExec sfcdb, string partno, string mpn, string scanType)
        {
            C_KP_Rule kpRule = new C_KP_Rule();

            try
            {
                string  sql = $@" select * from c_kp_rule where partno='{partno}' and mpn='{mpn}' and scantype='{scanType}' ";
                DataSet ds  = sfcdb.ExecSelect(sql);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    Row_C_KP_Rule row = (Row_C_KP_Rule)this.NewRow();
                    row.loadData(ds.Tables[0].Rows[0]);
                    kpRule = row.GetDataObject();
                }
                else
                {
                    kpRule = null;
                }
            }
            catch
            {
                kpRule = null;
            }
            return(kpRule);
        }
コード例 #2
0
ファイル: C_KP_Rule.cs プロジェクト: maoyongjun/cloudMESTJ
        public List <C_KP_Rule> GetCKpRule(OleExec DB, string Partno)
        {
            string           sql = Partno.Equals("") ? $@"SELECT * FROM c_kp_rule " : $@"SELECT * FROM c_kp_rule where PARTNO='{Partno}'";
            DataSet          DS  = DB.ExecSelect(sql);
            List <C_KP_Rule> CL  = new List <C_KP_Rule>();

            foreach (DataRow VARIABLE in DS.Tables[0].Rows)
            {
                Row_C_KP_Rule row = (Row_C_KP_Rule)this.NewRow();
                row.loadData(VARIABLE);
                CL.Add(row.GetDataObject());
            }
            return(CL);
        }
コード例 #3
0
ファイル: C_KP_Rule.cs プロジェクト: maoyongjun/cloudMESTJ
        public List <C_KP_Rule> GetDataBySkuWo(string WO, string Skuno, OleExec SFCDB)
        {
            string           strSql = $@"select distinct * from c_kp_rule where partno in 
(select partno from C_sku_mpn where skuno='{Skuno}')
or partno in
(select repalcepartno from R_WO_KP_Repalce where wo='{WO}')";
            List <C_KP_Rule> ret    = new List <C_KP_Rule>();
            DataSet          res    = SFCDB.RunSelect(strSql);

            for (int i = 0; i < res.Tables[0].Rows.Count; i++)
            {
                Row_C_KP_Rule R = new Row_C_KP_Rule(this.DataInfo);
                R.loadData(res.Tables[0].Rows[i]);
                ret.Add(R.GetDataObject());
            }
            return(ret);
        }