Exemplo n.º 1
0
        //点击出库按钮
        private void BaseButton_Inbound_Click(object sender, EventArgs e)
        {
            try
            {
                Outbound item = this.BuildOutbound();
                if (item == null || item.OutboundOrder.TotalCount == 0 || item.OutboundDetails.Count == 0)
                {
                    GlobalMessageBox.Show("出库单为空,不能发货!");
                    return;
                }
                if (GlobalMessageBox.Show("是否确认操作?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    return;
                }
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                InteractResult result = GlobalCache.ServerProxy.ReplenishOutbound(item);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    GlobalMessageBox.Show("发货成功!");

                    if (skinCheckBoxPrint.Checked)
                    {
                        DataGridView dgv = deepCopyDataGridView();
                        ReplenishOrderPrinter.Print(this.curReplenishOrder, dgv, 2);
                    }

                    WorkDesk_Refresh?.Invoke(false, null);
                    TabPage_Close?.Invoke(this.CurrentTabPage, this.SourceCtrlType);
                    break;

                case ExeResult.Error:
                    GlobalMessageBox.Show(result.Msg);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
                GlobalMessageBox.Show("出库失败!");
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Exemplo n.º 2
0
        private void Save(bool isHang)
        {
            try
            {
                if (!CheckValidate())
                {
                    return;
                }
                ReturnCostume item = this.Build();
                if (item == null || item.OutboundOrder.TotalCount == 0)
                {
                    GlobalMessageBox.Show("采购单为空,不能退货!");
                    return;
                }
                if (GlobalMessageBox.Show("是否确认操作?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    return;
                }
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }


                InteractResult result;
                if (isHang)
                {
                    result = GlobalCache.ServerProxy.HangUpReturn(item);
                }
                else
                {
                    //输入金额
                    //SelectMoneyForm form = new SelectMoneyForm();
                    //if (form.ShowDialog(this.FindForm()) == DialogResult.OK)
                    //{
                    item.ReturnOrder.PayMoney = numericTextBoxMoney.Value;    // form.result;
                    //}
                    //else
                    //{
                    //    return;
                    //}
                    result = GlobalCache.ServerProxy.ReturnCostume(item);
                }


                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    if (isHang)
                    {
                        GlobalMessageBox.Show("挂单成功!");
                    }
                    else
                    {
                        GlobalMessageBox.Show("退货成功!");
                        numericTextBoxMoney.Text = string.Empty;
                        if (skinCheckBoxPrint.Checked)
                        {
                            DataGridView dgv = deepCopyDataGridView();
                            //SumMoney.Visible = false;
                            //SumMoney.Tag = PurchaseReturnOrderPrinter.PrinterNoCount;
                            //Column2.Visible = false;
                            //Column2.Tag = PurchaseReturnOrderPrinter.PrinterNoCount;
                            PurchaseReturnOrderPrinter.Print(item.ReturnOrder, dgv, 2);
                            //SumMoney.Visible = true;
                            //Column2.Visible = true;
                        }
                    }

                    ResetAll(true);
                    if (!IsShowOnePage)
                    {
                        TabPage_Close?.Invoke(this.CurrentTabPage, this.SourceCtrlType);
                    }
                    break;

                case ExeResult.Error:
                    GlobalMessageBox.Show(result.Msg);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
        private void BaseButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (String.IsNullOrEmpty(skinTextBoxTitle.Text))
                {
                    GlobalMessageBox.Show("请输入模板名称!");
                    skinTextBoxTitle.Focus();
                    return;
                }


                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                //最后记得跟resultList对比下,判断是否省份所有城市都选中了
                Core.Dev.InteractEntity.CarriageCost para = new Core.Dev.InteractEntity.CarriageCost();
                para.CarriageCostTemplate = new EmCarriageCostTemplate()
                {
                    CreateTime          = DateTime.Now,
                    DeliveryTime        = (int)this.skinComboBoxDeliveryTime.SelectedValue,
                    DefaultCarriageCost = numericTextBoxDefaultCarriageCost.Value,
                    GoodsAddress        = skinComboBoxProvince.SelectedValue + "-" + skinComboBoxCity.SelectedValue + "-" + skinComboBoxCityArea.SelectedValue,
                    IsValid             = skinCheckBox_State.Checked,
                    LastEditTime        = DateTime.Now,
                    LastOperatorUserID  = GlobalCache.CurrentUserID,
                    Name = skinTextBoxTitle.Text
                };

                List <CarriageCost> costs = this.dataGridView1.DataSource as List <CarriageCost>;
                //周一实现
                para.CarriageCostDetails = CarriageCostUtil.GetEmCarriageCostDetails(costs);

                if (curTemp != null)
                {
                    para.CarriageCostTemplate.AutoID     = curTemp.AutoID;
                    para.CarriageCostTemplate.CreateTime = curTemp.CreateTime;
                    foreach (var item in para.CarriageCostDetails)
                    {
                        item.TemplateID = curTemp.AutoID;
                    }

                    UpdateResult result = GlobalCache.EMallServerProxy.UpdateCarriageCost(para);
                    switch (result)
                    {
                    case UpdateResult.Success:
                        GlobalMessageBox.Show("保存成功!");
                        //TabPage_Close.Invoke(this.CurrentTabPage, this.SourceCtrlType);
                        break;

                    case UpdateResult.Error:
                        GlobalMessageBox.Show("内部错误!");
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    InsertResult result = GlobalCache.EMallServerProxy.InsertCarriageCost(para);
                    switch (result)
                    {
                    case InsertResult.Success:
                        GlobalMessageBox.Show("保存成功!");
                        TabPage_Close.Invoke(this.CurrentTabPage, this.SourceCtrlType);
                        break;

                    case InsertResult.Error:
                        GlobalMessageBox.Show("内部错误!");
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Exemplo n.º 4
0
        //提交补货申请
        private void Save(bool isHang)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                if (string.IsNullOrEmpty(this.shopID))
                {
                    GlobalMessageBox.Show("请选择店铺!");
                    return;
                }

                /*  if (this.guideComboBox1.SelectedIndex == 0)
                 * {
                 *    GlobalMessageBox.Show("操作人不能为空!");
                 *    return;
                 * }
                 */
                ReplenishCostume item = this.BuildReplenishCostume();
                if (item == null)
                {
                    GlobalMessageBox.Show("补货明细不能为空!");
                    return;
                }
                if (item.ReplenishOrder.TotalCount <= 0)
                {
                    GlobalMessageBox.Show("补货数量应大于0");
                    return;
                }
                DialogResult dialogResult = GlobalMessageBox.Show("您确定该申请操作?", "提示", MessageBoxButtons.OKCancel);
                if (dialogResult != DialogResult.OK)
                {
                    return;
                }
                InteractResult result;

                if (isHang)
                {
                    result = GlobalCache.ServerProxy.HangUpReplenish(item);
                }
                else
                {
                    result = GlobalCache.ServerProxy.ReplenishCostume(item);
                }

                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    if (isHang)
                    {
                        GlobalMessageBox.Show("挂单成功!");
                    }
                    else
                    {
                        GlobalMessageBox.Show("补货申请成功!");
                        if (skinCheckBoxPrint.Checked)
                        {
                            DataGridView dgv = deepCopyDataGridView();
                            ReplenishOrderPrinter.Print(item.ReplenishOrder, dgv, 2);
                        }
                    }


                    ResetAll(true);
                    if (!IsShowOnePage)
                    {
                        TabPage_Close?.Invoke(this.CurrentTabPage, this.SourceCtrlType);
                    }

                    break;

                case ExeResult.Error:
                    GlobalMessageBox.Show(result.Msg);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Exemplo n.º 5
0
        //点击出库按钮
        private void Save(bool isHang)
        {
            try
            {
                bool pfPriceEmpty    = false;
                bool pfPriceSuperLen = false;
                bool pfMoneySuperLen = false;
                foreach (var detail in curInboundDetailList)
                {
                    if (detail.PfPrice == 0)
                    {
                        pfPriceEmpty = true;
                        break;
                    }
                    if (detail.PfPrice > 0 && detail.PfPrice > Convert.ToDecimal(99999999.99))
                    {
                        // SumPfMoney
                        pfPriceSuperLen = true;
                        break;
                    }
                    if (detail.SumPfMoney > 0 && detail.SumPfMoney > Convert.ToDecimal(99999999.99))
                    {
                        // SumPfMoney
                        pfMoneySuperLen = true;
                        break;
                    }
                }

                if (pfPriceSuperLen)
                {
                    GlobalMessageBox.Show("批发价不能大于99999999.99!");
                    return;
                }
                if (pfMoneySuperLen)
                {
                    GlobalMessageBox.Show("列表中批发每款商品总额不能大于99999999.99!");
                    return;
                }

                /*  if (pfPriceEmpty) {
                 *    GlobalMessageBox.Show("批发价不能为0,请重新输入!");
                 *    return;
                 * }*/

                PfInfo item = this.Build();
                if (item == null || item.PfOrder.TotalCount == 0 || item.PfOrderDetails.Count == 0)
                {
                    GlobalMessageBox.Show("发货单为空,不能发货!");
                    return;
                }
                //if (GlobalMessageBox.Show("是否确认操作?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                //{
                //    return;
                //}

                //弹窗录入付款方式
                //int payType= ShowPayTypeForm(item);
                //if (payType == -1)
                //{
                //    return;
                //}

                item.PfOrder.PayMoney = numericTextBoxMoney.Value;
                item.PfOrder.PayType  = (byte)GetPayType();
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                InteractResult result;
                if (isHang)
                {
                    result = GlobalCache.ServerProxy.HangUpPfDelivery(item);
                }
                else
                {
                    result = GlobalCache.ServerProxy.PfDelivery(item);
                }
                switch (result.ExeResult)
                {
                case ExeResult.Error:
                    GlobalMessageBox.Show(result.Msg);
                    break;

                default:
                    if (isHang)
                    {
                        GlobalMessageBox.Show("挂单成功!");
                    }
                    else
                    {
                        GlobalMessageBox.Show("发货成功!");

                        if (skinCheckBoxPrint.Checked)
                        {
                            //Column3.Visible = false;
                            //Column3.Tag = WholesaleDeliveryPrinter.PrinterNoCount;
                            //Column2.Visible = false;
                            //Column2.Tag = WholesaleDeliveryPrinter.PrinterNoCount;
                            //priceDataGridViewTextBoxColumn.Visible = false;
                            //priceDataGridViewTextBoxColumn.Tag = WholesaleDeliveryPrinter.PrinterNoCount;
                            //BoundDetailBrandIDDataGridViewTextBoxColumn.Visible = false;
                            //BoundDetailBrandIDDataGridViewTextBoxColumn.Tag = WholesaleDeliveryPrinter.PrinterNoCount;
                            DataGridView             dgv      = deepCopyDataGridView();
                            InteractResult <PfOrder> pfResult = GlobalCache.ServerProxy.GetOnePfOrder(item.PfOrder.ID);
                            decimal BalanceAllOld             = 0;
                            decimal BalanceAll = 0;
                            decimal totalPrice = 0;
                            if (pfResult.Data != null)
                            {
                                BalanceAllOld = pfResult.Data.PaymentBalanceOld;
                                BalanceAll    = pfResult.Data.PaymentBalance;
                                totalPrice    = pfResult.Data.TotalPfPrice;
                            }
                            item.PfOrder.PaymentBalanceOld = BalanceAllOld;
                            item.PfOrder.PaymentBalance    = BalanceAll;
                            item.PfOrder.TotalPfPrice      = totalPrice;
                            WholesaleDeliveryPrinter.Print(item.PfOrder, dgv, 2);
                            //Column3.Visible = true;
                            //Column2.Visible = true;
                            //priceDataGridViewTextBoxColumn.Visible = true;
                            //BoundDetailBrandIDDataGridViewTextBoxColumn.Visible = true;
                        }
                    }
                    //  UpdatePayType(payType,item);


                    ResetAll(true);
                    if (!IsShowOnePage)
                    {
                        TabPage_Close?.Invoke(this.CurrentTabPage, this.SourceCtrlType);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
                GlobalMessageBox.Show("发货失败!");
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }