/// <summary> /// 编辑或者复制调拨单 /// </summary> /// <param name="HandleType"></param> /// <param name="state"></param> private void EditOrCopyMethod(string HandleType, WindowStatus state) { try { string AllotId = string.Empty; List <string> BillIDlist = GetSelectedRecord();//获取要复制调拨单记录 if (BillIDlist.Count == 0 && gvAllotBillList.SelectedRows.Count == 0) { MessageBoxEx.Show("请选择要" + HandleType + "的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else if (BillIDlist.Count > 1 && gvAllotBillList.SelectedRows.Count > 1) { MessageBoxEx.Show("一次只能" + HandleType + "一条数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { if (BillIDlist.Count == 1) { AllotId = BillIDlist[0].ToString(); } else if (gvAllotBillList.SelectedRows.Count == 1) { AllotId = gvAllotBillList.CurrentRow.Cells["AllotID"].ToString(); } UCRequisitionAddOrEdit UCAllotBillHandle = new UCRequisitionAddOrEdit(state, AllotId, this); base.addUserControl(UCAllotBillHandle, "调拨单-" + HandleType, "UCAllotBillHandle", this.Tag.ToString(), this.Name); } } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question); } }
/// <summary> /// 添加调拨单 /// </summary> /// <param name="send"></param> /// <param name="e"></param> private void UCRequisitionManager_AddEvent(object send, EventArgs e) { try { UCRequisitionAddOrEdit UCAllotBillAdd = new UCRequisitionAddOrEdit(WindowStatus.Add, null, this); base.addUserControl(UCAllotBillAdd, "调拨单-添加", "UCAllotBillAdd", this.Tag.ToString(), this.Name); } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question); } }
/// <summary> /// 编辑或者复制调拨单 /// </summary> /// <param name="HandleType"></param> /// <param name="state"></param> private void EditOrCopyMethod(string HandleType, WindowStatus state) { try { string AllotId = string.Empty; List<string> BillIDlist = GetSelectedRecord();//获取要复制调拨单记录 if (BillIDlist.Count == 0 && gvAllotBillList.SelectedRows.Count==0) { MessageBoxEx.Show("请选择要" + HandleType + "的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else if (BillIDlist.Count > 1 && gvAllotBillList.SelectedRows.Count > 1) { MessageBoxEx.Show("一次只能" + HandleType + "一条数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { if (BillIDlist.Count == 1) { AllotId = BillIDlist[0].ToString(); } else if (gvAllotBillList.SelectedRows.Count == 1) { AllotId = gvAllotBillList.CurrentRow.Cells["AllotID"].ToString(); } UCRequisitionAddOrEdit UCAllotBillHandle = new UCRequisitionAddOrEdit(state, AllotId, this); base.addUserControl(UCAllotBillHandle, "调拨单-" + HandleType, "UCAllotBillHandle" , this.Tag.ToString(), this.Name); } } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question); } }