private void btnBind_Click(object sender, EventArgs e) { if (this.dbGridView.Rows.Count == 0 || this.dbGridView.SelectedCells.Count == 0) { return; } // using (var Fm = new M01_基础设置.BAS_货架设置_Select()) { Fm.Select_Mod((string)this.cbx仓库编码.SelectedValue); if (Fm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { foreach (DataGridViewCell Cell in this.dbGridView.SelectedCells) { this.dbGridView.Rows[Cell.RowIndex].Cells["存放货架"].Value = Fm.CKName; this.dbGridView.Rows[Cell.RowIndex].Cells["货架编码"].Value = Fm.CKCode; // var model = new Ref_WS_STK.DataType_库存管理(); model.ExAction = "Bind"; model.仓库编码 = (string)this.cbx仓库编码.SelectedValue; model.存货编码 = this.dbGridView.Rows[Cell.RowIndex].Cells["存货编码"].Value.ToString(); model.货架编码 = Fm.CKCode; model.LoginUserCode = AppServer.LoginUserCode; AppServer.UsingWcf(() => { AppServer.wcfClient.BAS_期初库存_Edit(ref model); }); } } } }
private void btnBind_Click(object sender, EventArgs e) { if (this.dbGridView_RK.Rows.Count == 0 || this.dbGridView_RK.SelectedCells.Count == 0) { return; } // DataTable dt = null; var model = new Ref_WS_STK.DataType_存货(); model.ExAction = "IsBind"; model.存货编码 = this.dbGridView_RK.Rows[this.dbGridView_RK.CurrentCell.RowIndex].Cells["存货编码"].Value.ToString(); model.默认仓库编码 = (string)this.cbx仓库编码.SelectedValue; AppServer.UsingWcf(() => { dt = AppServer.wcfClient.BAS_存货_List(model).Tables[0]; }); // if (dt.Rows.Count > 0) { if (!AppServer.DialogMsg(String.Format("存货“{0}”已经在货架“{1}”上了,是否更改存放货架?", this.dbGridView_RK.Rows[this.dbGridView_RK.CurrentCell.RowIndex].Cells["存货名称"].Value, dt.Rows[0]["仓库名称"].ToString()))) { return; } } // using (var Fm = new M01_基础设置.BAS_货架设置_Select()) { Fm.Select_Mod((string)this.cbx仓库编码.SelectedValue); if (Fm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { foreach (DataGridViewCell Cell in this.dbGridView_RK.SelectedCells) { this.dbGridView_RK.Rows[Cell.RowIndex].Cells["存放货架"].Value = Fm.CKName; this.dbGridView_RK.Rows[Cell.RowIndex].Cells["货架编码"].Value = Fm.CKCode; } } } }