/// <summary> /// Ìá½»²Ù×÷ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOK_Press(object sender, EventArgs e) { try { frmToolBarMenu fm = (frmToolBarMenu)this.Form; frmMessageLayout fml = (frmMessageLayout)fm.tabPageView1.Controls[4]; // if (((frmMessage)Form).eInfo == EuserInfo.ÐÞ¸ÄêdzÆ) if (fml.eInfo == EuserInfo.ÐÞ¸ÄêdzÆ) { if (String.IsNullOrEmpty(txtEditInfo.Text.Trim()) == false) { //((frmMessage)Form).UpdateUserInfo(EuserInfo.ÐÞ¸ÄêdzÆ, txtEditInfo.Text); //((frmMessage)Form).lblName.Text = txtEditInfo.Text; fml.UpdateUserInfo(EuserInfo.ÐÞ¸ÄêdzÆ, txtEditInfo.Text); fml.lblName.Text = txtEditInfo.Text; this.Close(); } else { throw new Exception("µ±Ç°ÉÐδÊäÈëêdzÆ!"); } } } catch (Exception ex) { Form.Toast(ex.Message); } }
/// <summary> /// 编辑销售单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ibEdit_Press(object sender, EventArgs e) { try { frmToolBarMenu fm = (frmToolBarMenu)this.Form; frmOrderLayout frmorder = (frmOrderLayout)fm.tabPageView1.Controls[1]; frmAssSalesOrderEdit edit = new frmAssSalesOrderEdit { SOID = lblName.BindDataValue.ToString() }; Form.Show(edit, (MobileForm sender1, object args) => { if (edit.ShowResult == ShowResult.Yes) { //((frmOrder)Form).Bind(((frmOrder)Form).type, ((frmOrder)Form).orderType); frmorder.Bind(frmorder.type, frmorder.orderType); } } ); } catch (Exception ex) { Toast(ex.Message); } }
/// <summary> /// µ¯³ö¿ò³õʼ»¯ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void EditUserInfoLayout_Load(object sender, EventArgs e) { try { frmToolBarMenu fm = (frmToolBarMenu)this.Form; frmMessageLayout fml = (frmMessageLayout)fm.tabPageView1.Controls[4]; // String editLbltxt=((frmMessage)Form).eInfo.ToString(); String editLbltxt = fml.eInfo.ToString(); // if (((frmMessage)Form).eInfo == EuserInfo.ÐÞ¸ÄêdzÆ) if (fml.eInfo == EuserInfo.ÐÞ¸ÄêdzÆ) { // if (((frmMessage)Form).lblName.Text.Trim().Length > 0) // txtEditInfo.Text = ((frmMessage)Form).lblName.Text; if (fml.lblName.Text.Trim().Length > 0) { txtEditInfo.Text = fml.lblName.Text; } else { txtEditInfo.Text = ""; } } } catch (Exception ex) { Form.Toast(ex.Message); } }
/// <summary> /// 点击行项,进入销售详情页查看 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void plRow_Press(object sender, EventArgs e) { frmToolBarMenu fm = (frmToolBarMenu)this.Form; frmOrderLayout frmorder = (frmOrderLayout)fm.tabPageView1.Controls[1]; frmConSalesResult frm = new frmConSalesResult(); frm.SOID = lblName.BindDataValue.ToString(); Form.Show(frm, (MobileForm sender1, object args) => { // ((frmOrder)Form).Bind(((frmOrder)Form).type, ((frmOrder)Form).orderType); frmorder.Bind(frmorder.type, frmorder.orderType); }); }
/// <summary> /// 耗材销售单编辑 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ibEdit_Press(object sender, EventArgs e) { frmToolBarMenu fm = (frmToolBarMenu)this.Form; frmOrderLayout frmorder = (frmOrderLayout)fm.tabPageView1.Controls[1]; frmConSalesCreate frm = new frmConSalesCreate { SOID = lblName.BindDataValue.ToString() }; Form.Show(frm, (MobileForm sender1, object args) => { if (frm.ShowResult == ShowResult.Yes) { frmorder.Bind(frmorder.type, frmorder.orderType); // ((frmOrder)Form).Bind(((frmOrder)Form).type, ((frmOrder)Form).orderType); } }); }
/// <summary> /// 行项点击 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void plRow_Press(object sender, EventArgs e) { try { frmToolBarMenu fm = (frmToolBarMenu)this.Form; frmOrderLayout frmorder = (frmOrderLayout)fm.tabPageView1.Controls[1]; frmAssPurchaseOrderResult result = new frmAssPurchaseOrderResult { POID = lblName.BindDataValue.ToString() }; Form.Show(result, (MobileForm sender1, object args) => { // ((frmOrder)Form).Bind(((frmOrder)Form).type, ((frmOrder)Form).orderType); frmorder.Bind(frmorder.type, frmorder.orderType); }); } catch (Exception ex) { Toast(ex.Message); } }
/// <summary> /// 删除列表行项 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelRow_Press(object sender, EventArgs e) { try { frmToolBarMenu fm = (frmToolBarMenu)this.Form; frmOrderLayout frmorder = (frmOrderLayout)fm.tabPageView1.Controls[1]; switch (Parent.Parent.ToString()) { case "SMOWMS.UI.Layout.frmAssPOLayout": AssPurchaseOrderOutputDto assPurchase = autofacConfig.AssPurchaseOrderService.GetById(((frmAssPOLayout)Parent.Parent).POID); if (assPurchase.STATUS == (int)PurchaseOrderStatus.采购中) { MessageBox.Show("你确定要删除该采购单吗?", "系统提醒", MessageBoxButtons.OKCancel, (object sender1, MessageBoxHandlerArgs args) => { try { if (args.Result == ShowResult.OK) //删除该采购单 { ReturnInfo rInfo = autofacConfig.AssPurchaseOrderService.DeletePurchaseOrder(((frmAssPOLayout)Parent.Parent).POID); if (rInfo.IsSuccess) { frmorder.Bind(frmorder.type, frmorder.orderType); // ((frmOrder)Form).Bind(((frmOrder)Form).type, ((frmOrder)Form).orderType); //刷新当前列表 Toast("删除采购单成功"); } else { throw new Exception(rInfo.ErrorInfo); } } } catch (Exception ex) { Form.Toast(ex.Message); } }); } else { throw new Exception("当前状态下无法删除该采购单"); } break; case "SMOWMS.UI.Layout.frmAssSOLayout": AssSalesOrderOutputDto assSale = autofacConfig.AssSalesOrderService.GetById(((frmAssSOLayout)Parent.Parent).SOID); if (assSale.STATUS == (int)SalesOrderStatus.销售中) { MessageBox.Show("你确定要刪除该销售单吗?", "系统提醒", MessageBoxButtons.OKCancel, (object sender1, MessageBoxHandlerArgs args) => { try { if (args.Result == ShowResult.OK) //删除该销售单 { ReturnInfo rInfo = autofacConfig.AssSalesOrderService.DeleteSalesOrder(((frmAssSOLayout)Parent.Parent).SOID); if (rInfo.IsSuccess) { frmorder.Bind(frmorder.type, frmorder.orderType); // ((frmOrder)Form).Bind(((frmOrder)Form).type, ((frmOrder)Form).orderType); //刷新当前列表 Toast("删除销售单成功"); } else { throw new Exception(rInfo.ErrorInfo); } } } catch (Exception ex) { Form.Toast(ex.Message); } }); } else { throw new Exception("当前状态下无法删除该销售单"); } break; case "SMOWMS.UI.Layout.frmConPurchaseLayout": ConPurchaseOrderOutputDto conPurchaseOrder = autofacConfig.ConPurchaseOrderService.GetByPOID(((frmConPurchaseLayout)Parent.Parent).POID); if (conPurchaseOrder.STATUS == (int)PurchaseOrderStatus.采购中) { MessageBox.Show("你确定要删除该采购单吗?", "系统提醒", MessageBoxButtons.OKCancel, (object sender1, MessageBoxHandlerArgs args) => { try { if (args.Result == ShowResult.OK) //删除该采购单 { ReturnInfo rInfo = autofacConfig.ConPurchaseOrderService.DeletePurchaseOrder(((frmConPurchaseLayout)Parent.Parent).POID); if (rInfo.IsSuccess) { frmorder.Bind(frmorder.type, frmorder.orderType); //((frmOrder)Form).Bind(((frmOrder)Form).type, ((frmOrder)Form).orderType); //刷新当前列表 Toast("删除采购单成功"); } else { Toast(rInfo.ErrorInfo); } } } catch (Exception ex) { Form.Toast(ex.Message); } }); } else { throw new Exception("当前状态下无法删除该采购单"); } break; case "SMOWMS.UI.Layout.frmConSalesLayout": ConSalesOrderOutputDto conSalesOrder = autofacConfig.ConSalesOrderService.GetBySOID(((frmConSalesLayout)Parent.Parent).SOID); if (conSalesOrder.STATUS == (int)SalesOrderStatus.销售中) { MessageBox.Show("你确定要删除该销售单吗?", "系统提醒", MessageBoxButtons.OKCancel, (object sender1, MessageBoxHandlerArgs args) => { try { if (args.Result == ShowResult.OK) //删除该销售单 { ReturnInfo rInfo = autofacConfig.ConSalesOrderService.DeleteSalesOrder(((frmConSalesLayout)Parent.Parent).SOID); if (rInfo.IsSuccess) { frmorder.Bind(frmorder.type, frmorder.orderType); // ((frmOrder)Form).Bind(((frmOrder)Form).type, ((frmOrder)Form).orderType); //刷新当前列表 Toast("删除销售单成功"); } else { Toast(rInfo.ErrorInfo); } } } catch (Exception ex) { Form.Toast(ex.Message); } }); } else { throw new Exception("当前状态下无法删除该销售单"); } break; case "SMOWMS.UI.Layout.frmCustomerLayout": MessageBox.Show("你确定要删除该客户吗?", "系统提醒", MessageBoxButtons.OKCancel, (object sender1, MessageBoxHandlerArgs args) => { try { if (args.Result == ShowResult.OK) //启用该仓库 { ReturnInfo rInfo = autofacConfig.customerService.DeleteCustomer(((frmCustomerLayout)Parent.Parent).cusId); if (rInfo.IsSuccess) { ((frmCustomer)Form).Bind(); Toast("删除客户成功"); } else { throw new Exception(rInfo.ErrorInfo); } } } catch (Exception ex) { Form.Toast(ex.Message); } }); break; case "SMOWMS.UI.Layout.frmVendorLayout": MessageBox.Show("你确定要删除该供货商吗?", "系统提醒", MessageBoxButtons.OKCancel, (object sender1, MessageBoxHandlerArgs args) => { try { if (args.Result == ShowResult.OK) //启用该仓库 { ReturnInfo rInfo = autofacConfig.vendorService.DeleteVendor(((frmVendorLayout)Parent.Parent).vId); if (rInfo.IsSuccess) { ((frmCustomer)Form).Bind(); Toast("删除供货商成功"); } else { throw new Exception(rInfo.ErrorInfo); } } } catch (Exception ex) { Form.Toast(ex.Message); } }); break; } } catch (Exception ex) { Form.Toast(ex.Message); } }