Example #1
0
        private void buttonGetStep_Click(object sender, EventArgs e)
        {
            try
            {
                MesDBAccess.BLL.palletBll palletDBAcc = new palletBll();
                string palletID = this.textBoxBarcode.Text;
                int    step     = 0;
                string reStr    = "";
                mesAcc.GetStep(palletID, out step, ref reStr);

                this.textBoxStep.Text = step.ToString();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Example #2
0
 private void buttonModifyStep_Click(object sender, EventArgs e)
 {
     try
     {
         MesDBAccess.BLL.palletBll palletDBAcc = new palletBll();
         string palletID = this.textBoxBarcode.Text;
         if (string.IsNullOrWhiteSpace(palletID))
         {
             return;
         }
         int    step  = int.Parse(this.textBoxStep.Text);
         string reStr = "";
         mesAcc.UpdateStep(step, palletID, ref reStr);
         logRecorder.AddDebugLog("手动操作", string.Format("手动操作,修改{0} 步号为{1}", palletID, step));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
        private bool RecordPalletInfo(string palletID, ref string strCataName, ref string reStr)
        {
            string strCata     = palletID.Substring(10, 1).ToUpper();
            int    productCata = 0;
            int    step        = 0;

            strCataName = "正极材料";

            if (strCata == "C")
            {
                strCataName = "正极材料";
                productCata = 1;

                step = 1;
            }
            else if (strCata == "A")
            {
                strCataName = "负极材料";
                productCata = 3;
                step        = 2;
            }
            else if (strCata == "S")
            {
                strCataName = "隔膜材料";
                productCata = 2;
                step        = 0;
            }
            else
            {
                if (this.db1ValsToSnd[0] != barcodeFailedStat)
                {
                    logRecorder.AddDebugLog(nodeName, "不可识别的条码类别:" + this.rfidUID);
                }
                return(false);
            }

            palletBll   palletDBll = new palletBll();
            palletModel pallet     = palletDBll.GetModel(this.rfidUID);

            if (pallet == null)
            {
                pallet            = new palletModel();
                pallet.stepNO     = step;
                pallet.bind       = true;
                pallet.palletID   = this.rfidUID;
                pallet.palletCata = productCata.ToString();
                if (!palletDBll.Add(pallet))
                {
                    logRecorder.AddDebugLog(nodeName, string.Format("物料{0}数据记录到数据库发生错误", this.rfidUID));
                    return(false);
                }
            }
            else
            {
                pallet.bind       = true;
                pallet.palletCata = productCata.ToString();
                pallet.stepNO     = step;
                if (!palletDBll.Update(pallet))
                {
                    logRecorder.AddDebugLog(nodeName, string.Format("物料{0}数据记录到数据库发生错误", this.rfidUID));
                    return(false);
                }
            }
            return(true);
        }