예제 #1
0
        public void GetBatteryInfo(Battery battery)
        {
            batteryModel model = bllBattery.GetModel(battery.BatteryID);

            if (model == null)
            {
                //this.View.ShowMessage("未找到该编号的电芯", "信息提示");
                return;
            }
            this.View.ShowBatteryInfo(model);
        }
예제 #2
0
        public bool UploadTrayCellInfo(string TrayNo, string opNO, string jsonCells, ref string reStr)
        {
            if (CheckPalletNum(TrayNo, ref reStr) == false)
            {
                reStr = "托盘编号不正确";
                return(false);
            }
            palletModel pallet      = bllPallet.GetModel(TrayNo);
            palletModel insertModel = new palletModel();

            insertModel.palletID = TrayNo;
            insertModel.stepNO   = 1;// 装载工位1
            insertModel.bind     = true;
            if (pallet == null)
            {
                //插入
                bllPallet.Add(insertModel);
            }
            else
            {
                bllPallet.Update(insertModel);
                //更新
            }

            JObject jsonCellObj = JObject.Parse(jsonCells);

            string[] objValue = jsonCellObj.Properties().Select(item => item.Name.ToString()).ToArray();

            List <batteryModel> palletBindBatterys = new List <batteryModel>();

            for (int i = 0; i < objValue.Length; i++)
            {
                string       batteryId     = jsonCellObj[objValue[1]].ToString();
                batteryModel insertBattery = new batteryModel();
                insertBattery.palletBinded = true;
                insertBattery.batteryID    = batteryId;
                insertBattery.channel      = (i + 1);
                insertBattery.palletID     = pallet.palletID;
                batteryModel battery = bllBattery.GetModel(batteryId);
                if (battery == null)//插入
                {
                    bllBattery.Add(insertBattery);
                }
                else//更新
                {
                    bllBattery.Update(insertBattery);
                }
            }

            return(true);
        }
예제 #3
0
 /// <summary>
 /// 显示电芯信息
 /// </summary>
 /// <param name="model"></param>
 public void ShowBatteryInfo(batteryModel model)
 {
     if (model == null)
     {
         return;
     }
     ClearBatteryInfo();
     this.txtEdit_batchName.Text   = model.batchName.ToString();
     this.txtEdit_batteryID1.Text  = model.batteryID.ToString();
     this.txtEdit_Channel.Text     = model.channel.ToString();
     this.txtEdit_OnlineTime.Text  = model.onlineTime.ToString();
     this.txtEdit_PalletID.Text    = model.palletID.ToString();
     this.txtEdit_productCata.Text = model.productCata.ToString();
     this.txtEdit_Binded.Text      = model.palletBinded.ToString();
 }
예제 #4
0
 public Battery(batteryModel model, int hoursIdle, int hoursTalk)
 {
     this.model     = model;
     this.hoursIdle = hoursIdle;
     this.hoursTalk = hoursTalk;
 }
예제 #5
0
 public Battery(batteryModel model, int hoursIdle, int hoursTalk)
 {
     this.model = model;
     this.hoursIdle = hoursIdle;
     this.hoursTalk = hoursTalk;
 }