Exemplo n.º 1
0
        /// <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);
            }
        }
Exemplo n.º 2
0
        /// <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);
            });
        }
Exemplo n.º 3
0
        /// <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);
                }
            });
        }
Exemplo n.º 4
0
        private void frmToolBarMenu_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            frmOrderLayout ly = (frmOrderLayout)tabPageView1.Controls[1];
            //  int i = ly.type;
            int type      = ly.type;
            int orderType = ly.orderType;

            switch (e.Index)
            {
            case 0:           //资产采购创建
                frmAssPurchaseOrderCreate frmAssPurchaseOrderCreate = new frmAssPurchaseOrderCreate();
                Show(frmAssPurchaseOrderCreate, (MobileForm senderAP, object args) =>
                {
                    ly.Bind(type, orderType);
                });
                break;

            case 1:          //资产销售创建
                frmAssSalesOrderCreate frmAssSalesOrderCreate = new frmAssSalesOrderCreate();
                Show(frmAssSalesOrderCreate, (MobileForm senderAS, object args) =>
                {
                    ly.Bind(type, orderType);
                });
                break;

            case 2:          //耗材采购创建
                frmConPurchaseCreate frmConPurchaseCreate = new frmConPurchaseCreate();
                Show(frmConPurchaseCreate, (MobileForm senderCP, object args) =>
                {
                    ly.Bind(type, orderType);
                });
                break;

            case 3:          //耗材销售创建
                frmConSalesCreate frmConSalesCreate = new frmConSalesCreate();
                Show(frmConSalesCreate, (MobileForm senderCS, object args) =>
                {
                    ly.Bind(type, orderType);
                });
                break;
            }
        }
Exemplo n.º 5
0
        /// <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);
            }
        }
Exemplo n.º 6
0
        /// <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);
            }
        }