/// <summary> /// 其它收货单编辑或复制 /// </summary> /// <param name="HandleType"></param> /// <param name="state"></param> private void EditOrCopyMethod(string HandleType, WindowStatus state) { try { string ReceiptId = string.Empty; List <string> BillIDlist = GetSelectedRecord();//获取复制的其它收货单记录 if (BillIDlist.Count == 0 && gvReceiptBillList.Rows.Count == 0) { MessageBoxEx.Show("请选择要" + HandleType + "的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else if (BillIDlist.Count > 1 && gvReceiptBillList.Rows.Count > 1) { MessageBoxEx.Show("一次只能" + HandleType + "一条数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { if (BillIDlist.Count == 1) { ReceiptId = BillIDlist[0].ToString(); } else if (gvReceiptBillList.SelectedRows.Count == 1) { ReceiptId = gvReceiptBillList.CurrentRow.Cells["RecptId"].ToString(); } UCStockReceiptAddOrEdit UCReceiptBillHandle = new UCStockReceiptAddOrEdit(state, ReceiptId, this); base.addUserControl(UCReceiptBillHandle, "其它收货单-" + HandleType, "UCReceiptBillHandle", 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 ReceiptId = string.Empty; List<string> BillIDlist = GetSelectedRecord();//获取复制的其它收货单记录 if (BillIDlist.Count == 0 && gvReceiptBillList.Rows.Count==0) { MessageBoxEx.Show("请选择要" + HandleType + "的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else if (BillIDlist.Count > 1 && gvReceiptBillList.Rows.Count >1) { MessageBoxEx.Show("一次只能" + HandleType + "一条数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { if (BillIDlist.Count == 1) { ReceiptId = BillIDlist[0].ToString(); } else if (gvReceiptBillList.SelectedRows.Count == 1) { ReceiptId = gvReceiptBillList.CurrentRow.Cells["RecptId"].ToString(); } UCStockReceiptAddOrEdit UCReceiptBillHandle = new UCStockReceiptAddOrEdit(state, ReceiptId, this); base.addUserControl(UCReceiptBillHandle, "其它收货单-" + HandleType, "UCReceiptBillHandle", 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 UCStockReceiptManager_AddEvent(object send, EventArgs e) { UCStockReceiptAddOrEdit UCReceiptBillAdd = new UCStockReceiptAddOrEdit(WindowStatus.Add, null, this); base.addUserControl(UCReceiptBillAdd, "其它收货单-添加", "UCReceiptBillAdd", this.Tag.ToString(), this.Name); }
/// <summary> /// 添加其它收货单 /// </summary> /// <param name="send"></param> /// <param name="e"></param> private void UCStockReceiptManager_AddEvent(object send, EventArgs e) { UCStockReceiptAddOrEdit UCReceiptBillAdd = new UCStockReceiptAddOrEdit(WindowStatus.Add, null, this); base.addUserControl(UCReceiptBillAdd, "其它收货单-添加", "UCReceiptBillAdd", this.Tag.ToString(), this.Name); }