private void OnDelFenrongCfg() { string batteryCata = this.comboBox1.Text; string fenrongZone = this.comboBox2.Text; if (string.IsNullOrWhiteSpace(batteryCata) || string.IsNullOrWhiteSpace(fenrongZone)) { MessageBox.Show("输入为空,请重新输入"); return; } MesDBAccess.BLL.BatteryFenrongCfgBll fenrongCfgBll = new MesDBAccess.BLL.BatteryFenrongCfgBll(); if (!fenrongCfgBll.Exist(batteryCata, fenrongZone)) { MessageBox.Show(string.Format("{0}-{1}配置不存在", batteryCata, fenrongZone), "提示"); return; } if (PoupAskmes("确定要删除?") != 1) { return; } if (fenrongCfgBll.Del(batteryCata, fenrongZone)) { MessageBox.Show("删除成功!"); OnRefreshFenrongCfgs(string.Format("batteryCataCode='{0}'", this.comboBox1.Text)); } }
private string AsrsAreaToCheckin(string palletID, AsrsControl.AsrsCtlModel asrsCtl, int step) { string area = ""; if (step == 0) { area = "空筐区"; //if (asrsCtl.HouseName == "C1库房" || asrsCtl.HouseName == "C2库房" || asrsCtl.HouseName == "C3库房") //{ // area = "空筐区"; //} //else //{ // area = SysCfg.SysCfgModel.asrsStepCfg.AsrsAreaSwitch(step); //} } else { if (asrsCtl.HouseName == "B1库房") { string batteryCata = ""; if (palletID.Length >= 11) { batteryCata = palletID.Substring(0, 4); } else { //return area; batteryCata = "F33A"; } MesDBAccess.BLL.BatteryFenrongCfgBll batteryFenrongBll = new MesDBAccess.BLL.BatteryFenrongCfgBll(); string strWhere = string.Format("batteryCataCode = '{0}'", batteryCata); List <MesDBAccess.Model.BatteryFenrongCfgModel> batteryFenrongList = batteryFenrongBll.GetModelList(strWhere, "fenrongZone"); foreach (MesDBAccess.Model.BatteryFenrongCfgModel cfgM in batteryFenrongList) { string areaCheckin = cfgM.fenrongZone; int validCells = 0; string reStr = ""; if (!asrsResManage.GetHouseAreaLeftGs(asrsCtl.HouseName, areaCheckin, ref validCells, reStr)) { Console.WriteLine("{0}获取 {1} 剩余货位数量失败", asrsCtl.HouseName, areaCheckin); continue; } if (validCells > 0) { area = areaCheckin; break; } } } else { area = SysCfg.SysCfgModel.asrsStepCfg.AsrsAreaSwitch(step); } } return(area); }
private void OnRefreshFenrongCfgs(string strWhere) { MesDBAccess.BLL.BatteryFenrongCfgBll fenrongCfgBll = new MesDBAccess.BLL.BatteryFenrongCfgBll(); DataSet ds = fenrongCfgBll.GetList(strWhere); this.dataGridView1.DataSource = ds.Tables[0]; this.dataGridView1.Columns["fenrongCfgID"].HeaderText = "配置ID"; this.dataGridView1.Columns["batteryCataCode"].HeaderText = "电芯型号"; this.dataGridView1.Columns["fenrongZone"].HeaderText = "分容库区"; this.dataGridView1.Columns["mark"].HeaderText = "备注"; this.dataGridView1.Columns["tag1"].Visible = false; this.dataGridView1.Columns["tag2"].Visible = false; this.dataGridView1.Columns["tag3"].Visible = false; this.dataGridView1.Columns["tag4"].Visible = false; this.dataGridView1.Columns["tag5"].Visible = false; this.dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; this.dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; }
private void OnAddFenrongCfg() { string batteryCata = this.comboBox1.Text; string fenrongZone = this.comboBox2.Text; if (string.IsNullOrWhiteSpace(batteryCata) || string.IsNullOrWhiteSpace(fenrongZone)) { MessageBox.Show("输入为空,请重新输入"); return; } MesDBAccess.BLL.BatteryFenrongCfgBll fenrongCfgBll = new MesDBAccess.BLL.BatteryFenrongCfgBll(); if (fenrongCfgBll.Exist(batteryCata, fenrongZone)) { MessageBox.Show(string.Format("已经存在{0}-{1}配置", batteryCata, fenrongZone), "提示"); return; } MesDBAccess.Model.BatteryFenrongCfgModel fenrongCfg = new MesDBAccess.Model.BatteryFenrongCfgModel(); fenrongCfg.batteryCataCode = batteryCata; fenrongCfg.fenrongZone = fenrongZone; fenrongCfg.fenrongCfgID = System.Guid.NewGuid().ToString(); fenrongCfg.mark = textBox3.Text; fenrongCfgBll.Add(fenrongCfg); }