private void toolStripMenuItem1_Click(object sender, EventArgs e) { DrugsBaseApplyZyc model = li[CurrentRowIndex]; DrugsBaseSoapClient bll = new DrugsBaseSoapClient(); model.status = "未审核"; model.updated = DateTime.Now; bll.ModifyDrugsBaseApplyZyc(model, AddDrugBase.key); Bind(); }
private void toolStripMenuItem2_Click(object sender, EventArgs e) { DataGridViewRow row = dataGridViewX1.Rows[CurrentRowIndex]; DrugsBaseApplyZyc model = li[CurrentRowIndex]; AddDrugBaseZyc ad = new AddDrugBaseZyc(_idenName); ad.model = model; ad.isSee = true; ad.ShowDialog(); }
private void 修改ToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRow row = dataGridViewX1.Rows[CurrentRowIndex]; if (!"已审核".Equals(row.Cells["Column13"].Value)) { DrugsBaseApplyZyc model = li[CurrentRowIndex]; AddDrugBaseZyc ad = new AddDrugBaseZyc(_idenName); ad.model = model; ad.ShowDialog(); } }
private void buttonX1_Click(object sender, EventArgs e) { DrugsBaseApplyZyc dba = new DrugsBaseApplyZyc(); if (model != null) { dba = model; } int drugid = 0; int.TryParse(labDrugBaseID.Text, out drugid); dba.DrugsBase_ID = drugid; dba.DrugsBase_DrugName = this.txtTym.Text; dba.DrugsBase_ProName = this.txtSpm.Text; dba.DrugsBase_Formulation_1 = this.txtPx.Text; dba.DrugsBase_Manufacturer = this.txtCj.Text; dba.DrugsBase_Specification = this.txtGg.Text; dba.ProductionAddress = this.txtCd.Text; dba.ProductionLevel = this.txtDj.Text; dba.ProductionMethod = this.txtZf.Text; dba.ProductionClass = this.comboBoxEx1.Text; dba.ProductionBrand = this.txtSpm.Text; dba.DrugsBase_Formulation = "中药饮片"; if (BagCapacity7.Text == "") { dba.BagCapacity = 1M; } else { dba.BagCapacity = decimal.Parse(BagCapacity7.Text); } //dba.cunchtj = this.comboCcfs.Text; //if (dba.cunchtj == "") //{ // MessageBox.Show("亲,请选择存储条件"); // return; //} dba.Goods_ConveRatio = 1; //dba.Goods_ConveRatio_Unit = this.txtPx.Text; dba.Goods_Unit = this.txtBzdw.Text; dba.source = _idenName; dba.sourceName = Login.userName; int jz = 0; if (!int.TryParse(this.txtJz.Text, out jz) && string.IsNullOrEmpty(this.txtJz.Text)) { MessageBox.Show("亲,件装请填写数字"); return; } dba.Goods_Pcs = jz; int zbz = 0; if (!int.TryParse(this.txtZbz.Text, out zbz) && string.IsNullOrEmpty(this.txtZbz.Text)) { MessageBox.Show("亲,中包装请填写数字"); return; } int zhbid = 0; int.TryParse(this.labZhbId.Text, out zhbid); dba.Goods_ID = zhbid; int zhb = 0; int.TryParse(this.txtZhb.Text, out zhb); dba.Goods_ConveRatio = zhb; dba.Goods_ConveRatio_Unit = this.txtZhbDw.Text; dba.Goods_ConveRatio_Unit_Name = this.txtZhbsm.Text; dba.DrugsClass = "2"; dba.Goods_Pcs_Small = zbz; dba.status = "未提交"; dba.created = DateTime.Now; dba.updated = null; //List<string> images=new List<string>(); //for(int i=0;i<listBox1.Items.Count;i++) //{ // images.Add(listBox1.Items[i].ToString()); //} if (images.Count == 0) { MessageBox.Show("亲,请您上传该产品的图片后再来提交!"); return; } dba.ImageList = images.ToArray(); if (isn(dba.DrugsBase_DrugName) && isn(dba.DrugsBase_Manufacturer) && isn(dba.DrugsBase_Specification) && isn(dba.Goods_Unit)) { if (model == null) { db.AppendDrugsBaseApplyZyc(dba, key); MessageBox.Show("保存成功"); } else { db.ModifyDrugsBaseApplyZyc(dba, key); MessageBox.Show("保存成功"); this.Close(); } txtClear(); } else { MessageBox.Show("亲,请检查数据是否完整!"); } }