Esempio n. 1
0
        public static void EditRule(string pnkey, string ruleid, string wt, string err, string para, string low, string high, string ruleres, string tc)
        {
            var sql = "update PnRulesVM set WhichTest=@WhichTest,ErrAbbr=@ErrAbbr,Param=@Param,LowLimit=@LowLimit,HighLimit=@HighLimit,RuleRes= @RuleRes,TestCase= @TestCase where RuleID = @RuleID";
            var pa  = new Dictionary <string, string>();

            pa.Add("@RuleID", ruleid);
            pa.Add("@WhichTest", wt);
            pa.Add("@ErrAbbr", err);
            pa.Add("@Param", para);
            pa.Add("@LowLimit", low);
            pa.Add("@HighLimit", high);
            pa.Add("@RuleRes", ruleres);
            pa.Add("@TestCase", tc);
            DBUtility.ExeLocalSqlNoRes(sql, pa);
            PnMESVM.BindMesTab(pnkey, wt);
        }
Esempio n. 2
0
        public static void MatchRudeRule(List <ScrapTableItem> scraptable)
        {
            var pnmesmap = PnMESVM.RetriveMESKey2TestDict();

            foreach (var item in scraptable)
            {
                if (!string.IsNullOrEmpty(item.TestData.DataID))
                {
                    if (pnmesmap.ContainsKey(item.TestData.MESTab + item.PNKey))
                    {
                        item.WhichTest = pnmesmap[item.TestData.MESTab + item.PNKey];
                        item.RlueList  = PnRulesVM.RetrieveRule(item.PNKey, item.WhichTest, item.TestData.ErrAbbr);
                    }
                }
            }//end foreach
        }
Esempio n. 3
0
        public static void AddRule(string pnkey, string ruleid, string wt, string err, string para, string low, string high, string ruleres, string tc)
        {
            var sql = "insert into PnRulesVM(PnKey,RuleID,WhichTest,ErrAbbr,Param,LowLimit,HighLimit,RuleRes,CreateDate,TestCase) values(@PnKey,@RuleID,@WhichTest,@ErrAbbr,@Param,@LowLimit,@HighLimit,@RuleRes,@CreateDate,@TestCase)";
            var pa  = new Dictionary <string, string>();

            pa.Add("@PnKey", pnkey);
            pa.Add("@RuleID", ruleid);
            pa.Add("@WhichTest", wt);
            pa.Add("@ErrAbbr", err);
            pa.Add("@Param", para);
            pa.Add("@LowLimit", low);
            pa.Add("@HighLimit", high);
            pa.Add("@RuleRes", ruleres);
            pa.Add("@CreateDate", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            pa.Add("@TestCase", tc);
            DBUtility.ExeLocalSqlNoRes(sql, pa);
            PnMESVM.BindMesTab(pnkey, wt);
        }
Esempio n. 4
0
        private static List <PnMESVM> RetrievePnMESTab(string pnkey, string whichtest)
        {
            var ret = new List <PnMESVM>();

            var sql   = "select PNKey,WhichTest,MESTab,Bind from PnMESVM where PNKey = @PNKey and WhichTest = @WhichTest";
            var param = new Dictionary <string, string>();

            param.Add("@PNKey", pnkey);
            param.Add("@WhichTest", whichtest);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, param);

            foreach (var line in dbret)
            {
                var tempvm = new PnMESVM(Convert.ToString(line[0]), Convert.ToString(line[1])
                                         , Convert.ToString(line[2]), Convert.ToString(line[3]));
                ret.Add(tempvm);
            }
            return(ret);
        }