Example #1
0
        public override string ParsePalletID(string palletID)
        {
            //throw new NotImplementedException();
            if (string.IsNullOrWhiteSpace(palletID))
            {
                return(string.Empty);
            }
            if (palletID.Length < 12)
            {
                return(string.Empty);
            }
            string  re          = "";
            JObject jsonObj     = new JObject(new JProperty("电芯型号", ""), new JProperty("料筐内衬类型", ""), new JProperty("料筐内衬PLC值", ""), new JProperty("分容库区", ""));
            string  batteryCata = palletID.Substring(0, 4);

            jsonObj["电芯型号"] = batteryCata;
            MesDBAccess.BLL.BatteryCataBll     batCataBll   = new MesDBAccess.BLL.BatteryCataBll();
            MesDBAccess.Model.BatteryCataModel batCataModel = batCataBll.GetModel(batteryCata);
            if (batCataModel == null)
            {
                return(string.Empty);
            }
            MesDBAccess.BLL.PalletCataBll     palletCataBll   = new MesDBAccess.BLL.PalletCataBll();
            MesDBAccess.Model.PalletCataModel palletCataModel = palletCataBll.GetModel(batCataModel.palletCataID);
            if (palletCataModel == null)
            {
                return(string.Empty);
            }
            jsonObj["料筐内衬类型"]   = batCataModel.palletCataID;
            jsonObj["料筐内衬PLC值"] = palletCataModel.plcDefVal;
            jsonObj["分容库区"]     = batCataModel.fenrongZone;
            re = jsonObj.ToString();
            return(re);
        }
Example #2
0
        private void OnRefreshBatteryCata()
        {
            MesDBAccess.BLL.PalletCataBll            palletCataBll = new MesDBAccess.BLL.PalletCataBll();
            List <MesDBAccess.Model.PalletCataModel> palletCatas   = palletCataBll.GetModelList("");

            this.comboBox6.Items.Clear();
            foreach (MesDBAccess.Model.PalletCataModel m in palletCatas)
            {
                this.comboBox6.Items.Add(m.PalletCataID);
            }
            if (this.comboBox6.Items.Count > 0)
            {
                this.comboBox6.SelectedIndex = 0;
            }
            MesDBAccess.BLL.BatteryCataBll batCatBll = new MesDBAccess.BLL.BatteryCataBll();
            DataSet ds = batCatBll.GetAllList();

            this.dataGridView3.DataSource = ds.Tables[0];
            this.dataGridView3.Columns["batteryCataCode"].HeaderText = "电芯型号";
            this.dataGridView3.Columns["palletCataID"].HeaderText    = "料筐型号";
            this.dataGridView3.Columns["mark"].HeaderText            = "备注";
            this.dataGridView3.Columns["tag1"].Visible = false;
            this.dataGridView3.Columns["tag2"].Visible = false;
            this.dataGridView3.Columns["tag3"].Visible = false;
            this.dataGridView3.Columns["tag4"].Visible = false;
            this.dataGridView3.Columns["tag5"].Visible = false;
            this.dataGridView3.AutoSizeRowsMode        = DataGridViewAutoSizeRowsMode.AllCells;
            this.dataGridView3.AutoSizeColumnsMode     = DataGridViewAutoSizeColumnsMode.AllCells;
        }