private void button3_Click(object sender, EventArgs e) { if (this.dgv_cz.SelectedRows.Count <= 0) { return; } if (this.dgv_cz.SelectedRows[0].Cells[0].Value == null) { return; } if (this.dgv_cz.SelectedRows[0].Cells[0].Value.ToString().Trim() == null) { return; } string czfrom = this.dgv_cz.SelectedRows[0].Cells["CzFrom"].Value.ToString(); string czto = this.dgv_cz.SelectedRows[0].Cells["CzTo"].Value.ToString(); FormCopyAdd fca = new FormCopyAdd(); //传入参数 fca.barsysid_ = this.barsysid_; fca.ManufactCode_ = this.manufactCode_; fca.Mtype_ = this.mtype_; fca.hctype_ = this.hctype_; fca.CzFrom = czfrom; fca.CzTo = czto; // fca.type = "add"; if (fca.ShowDialog() == DialogResult.OK) { //this.czorder_ = 1; this.dgv_hs_CellClick(null, null); } }
private void button4_Click(object sender, EventArgs e) { if (this.dgv_cz.SelectedRows.Count <= 0) { return; } if (this.dgv_cz.SelectedRows[0].Cells[0].Value == null) { return; } if (this.dgv_cz.SelectedRows[0].Cells[0].Value.ToString().Trim() == null) { return; } string czfrom = this.dgv_cz.SelectedRows[0].Cells["CzFrom"].Value.ToString(); string czto = this.dgv_cz.SelectedRows[0].Cells["CzTo"].Value.ToString(); string sql_ = "select lastNum from T_RecordCopy where barsysid=" + this.barsysid_ + " and mtype='" + this.mtype_ + "' and manufactcode='" + this.manufactCode_ + "' and hctype='" + this.hctype_ + "' and Czfrom='" + czfrom + "'" + " and czto='" + czto + "'"; bool isexist = (new DBUtil()).yn_exist_data(sql_); if (!isexist) { MessageBox.Show("该次还未抄张,不能执行修改操作!"); return; } FormCopyAdd fca = new FormCopyAdd(); //传入参数 fca.barsysid_ = this.barsysid_; fca.ManufactCode_ = this.manufactCode_; fca.Mtype_ = this.mtype_; fca.hctype_ = this.hctype_; fca.CzFrom = czfrom; fca.CzTo = czto; fca.type = "edit"; if (fca.ShowDialog() == DialogResult.OK) { this.dgv_hs_CellClick(null, null); } }