Esempio n. 1
0
        private Boolean ConnectionSiteWeb()
        {
            try
            {
                this.ShowConnectingMessage("获取账套中……");
                String response = null;
                if (!GlobalUtil.GetBusinessAccountFromAPI(config, out response, this.skinTextBoxBusinessAccount.Text))
                {
                    this.ShowConnectingMessage(response, true, skinTextBoxBusinessAccount);
                    //skinTextBoxBusinessAccount.Focus();
                    return(false);
                }
                else
                {
                    this.ShowConnectingMessage("账套获取成功!");

                    //保存商户网站信息

                    //if (DateTime.Now > config.BusinessAccount.ExpiredDate) {
                    //    this.ShowConnectingMessage("账号", true, skinTextBoxBusinessAccount);
                    //}

                    config.Save(CONFIG_PATH);


                    return(true);
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.WriteLog(ex);
                this.ShowConnectingMessage("连接不到站点,请联系客服!", true, null);
                return(false);
            }
        }
 private void PageControlPanel21_CurrentPageIndexChanged(int index)
 {
     try
     {
         if (GlobalUtil.EngineUnconnectioned(this))
         {
             return;
         }
         if (this.pagePara == null)
         {
             return;
         }
         this.pagePara.PageIndex = index;
         RefundListPage listPage = GlobalCache.ServerProxy.GetRefundListPage(this.pagePara);
         this.BindingRefundOrderDataSource(listPage);
         this.BindingRefundDetailDataSource(null);
     }
     catch (Exception ee)
     {
         GlobalUtil.WriteLog(ee);
     }
     finally
     {
         GlobalUtil.UnLockPage(this);
     }
 }
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
     {
         return;
     }
     try
     {
         if (e.RowIndex > -1 && e.ColumnIndex > -1)
         {
             if (e.ColumnIndex == Column1.Index)
             {
                 PfCustomerRetailDetail detail = this.PfCustomerRetailDetailList[e.RowIndex];
                 this.PfCustomerRetailDetailList.RemoveAt(e.RowIndex);
                 if (PfCustomerRetailDetailList != null && PfCustomerRetailDetailList.Count == 0)
                 {
                     // 删除判断是否整个清空了,如果清空了,则清空客户信息
                     lastAddCustomer = null;
                 }
                 dataGridViewPagingSumCtrl.BindingDataSource(DataGridViewUtil.ListToBindingList(this.PfCustomerRetailDetailList));
             }
         }
     }
     catch (Exception ee)
     {
         GlobalUtil.WriteLog(ee);
     }
 }
Esempio n. 4
0
 private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
     {
         return;
     }
     if (e.RowIndex < 0 || e.ColumnIndex < 0)
     {
         return;
     }
     try
     {
         switch (this.dataGridView2.Rows[e.RowIndex].Cells[e.ColumnIndex].Value)
         {
         case "删除":
             DialogResult dialogResult = GlobalMessageBox.Show("确定删除该条数据?", "提示", MessageBoxButtons.OKCancel);
             if (dialogResult != DialogResult.OK)
             {
                 return;
             }
             this.curReplenishDetailList.RemoveAt(e.RowIndex);
             this.BindingReplenishDetailSource();
             break;
         }
     }
     catch (Exception ee)
     {
         GlobalUtil.WriteLog(ee);
     }
 }
Esempio n. 5
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
     {
         return;
     }
     if (e.RowIndex < 0 || e.ColumnIndex < 0)
     {
         return;
     }
     try
     {
         List <PurchaseOrder> curPurchaseOrderListSource = (List <PurchaseOrder>) this.dataGridView1.DataSource;
         PurchaseOrder        item = curPurchaseOrderListSource[e.RowIndex];
         switch (this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].OwningColumn.HeaderText)
         {
         case "采购进货单明细":
             if (this.DetailClick != null)
             {
                 this.skinSplitContainer1.Panel2Collapsed = false;
                 this.DetailClick(item, this.skinSplitContainer1.Panel2);
             }
             break;
         }
     }
     catch (Exception ex)
     {
         GlobalUtil.WriteLog(ex);
     }
 }
Esempio n. 6
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            try
            {
                //List <PurchaseOrder> curReturnOrderListSource = (List<PurchaseOrder>)this.dataGridView1.DataSource;
                //PurchaseOrder item = curReturnOrderListSource[e.RowIndex];

                //if (ColumnOrder.Index == e.ColumnIndex) {
                //        this.skinSplitContainer1.Panel2Collapsed = false;
                //        this.DetailClick?.Invoke(item, this.skinSplitContainer1.Panel2,false);
                //} else if (ColumnPrint.Index== e.ColumnIndex) {
                //        this.DetailClick?.Invoke(item, this.skinSplitContainer1.Panel2,true);

                //}
            }
            catch (Exception ex)
            {
                GlobalUtil.WriteLog(ex);
            }
        }
Esempio n. 7
0
        private void BaseButton_TakeInteger_Click(object sender, EventArgs e)
        {
            try
            {
                decimal newSmallMoneyRemoved = decimal.Parse(this.skinTextBox_TakeInteger.SkinTxt.Text);
                if (newSmallMoneyRemoved > GlobalCache.GetShop(this.shopID).MaxChangeRemoved)
                {
                    GlobalMessageBox.Show(string.Format("抹零金额不能大于店铺的最大抹零金额:{0}元", GlobalCache.GetShop(this.shopID).MaxChangeRemoved));
                    return;
                }

                decimal oldSmallMoneyRemoved = 0;
                if (this.m_SmallMoneyRemoved != 0)
                {
                    oldSmallMoneyRemoved = this.m_SmallMoneyRemoved;
                }
                this.m_SmallMoneyRemoved = newSmallMoneyRemoved;

                this.skinLabel_TakeIntegerMoney.Text = this.m_SmallMoneyRemoved.ToString();
                this.totalMoneyReceived = this.totalMoneyReceived + oldSmallMoneyRemoved - this.m_SmallMoneyRemoved;
                this.skinLabel_TotalMoneySupposed.Text = this.totalMoneyReceived.ToString();
                this.skinLabel_MoneyChange.Text        = this.moneyChange.ToString();
                this.moneyChange = this.moneyChange - oldSmallMoneyRemoved + this.m_SmallMoneyRemoved;
                this.skinTextBox_TakeInteger.SkinTxt.Text = "";
                UpdateMoneyValue();
            }
            catch (Exception ee)
            {
                GlobalUtil.WriteLog(ee);
                GlobalMessageBox.Show("抹零金额格式不正确");
            }
        }
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
     {
         return;
     }
     try
     {
         if (e.RowIndex > -1 && e.ColumnIndex > -1)
         {
             if (CommonGlobalUtil.ConvertToString(this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value) == "删除")
             {
                 //DialogResult dialogResult = GlobalMessageBox.Show("确定删除该条数据?", "提示", MessageBoxButtons.OKCancel);
                 //if (dialogResult != DialogResult.OK)
                 //{
                 //    return;
                 //}
                 PfCustomerRetailDetail detail = this.PfCustomerRetailDetailList[e.RowIndex];
                 this.PfCustomerRetailDetailList.RemoveAt(e.RowIndex);
                 dataGridViewPagingSumCtrl.BindingDataSource(this.PfCustomerRetailDetailList);
             }
         }
     }
     catch (Exception ee)
     {
         GlobalUtil.WriteLog(ee);
     }
 }
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
     {
         return;
     }
     if (e.RowIndex < 0 || e.ColumnIndex < 0)
     {
         return;
     }
     try
     {
         List <PfOrder> curReturnOrderListSource = (List <PfOrder>) this.dataGridView1.DataSource;
         PfOrder        item = curReturnOrderListSource[e.RowIndex];
         if (Column1.Index == e.ColumnIndex)
         {
             this.skinSplitContainer1.Panel2Collapsed = false;
             this.DetailClick?.Invoke(item, this.skinSplitContainer1.Panel2, false);
         }
         else if (Column2.Index == e.ColumnIndex)
         {
             this.DetailClick?.Invoke(item, this.skinSplitContainer1.Panel2, true);
         }
         else if (ColumnCancel.Index == e.ColumnIndex)
         {
             this.Cancel(item);
         }
         else if (ColumnRedo.Index == e.ColumnIndex)
         {
             this.Redo(item);
         }
         else if (ColumnPick.Index == e.ColumnIndex)
         {
             this.Pick(item);
         }
         else if (Column4.Index == e.ColumnIndex)
         {
             string fileName = "";
             if (item.IsRefundOrder)
             {
                 fileName = "批发退货单";
             }
             else
             {
                 fileName = "批发发货单";
             }
             path = CJBasic.Helpers.FileHelper.GetPathToSave("保存文件", fileName + item.ID + new Date(DateTime.Now).ToDateInteger() + ".xls", Environment.GetFolderPath(Environment.SpecialFolder.Personal));
             if (String.IsNullOrEmpty(path))
             {
                 return;
             }
             DetailExcept?.Invoke(item, this.skinSplitContainer1.Panel2, path);
         }
     }
     catch (Exception ex)
     {
         GlobalUtil.WriteLog(ex);
     }
 }
Esempio n. 10
0
 private void baseButtonPick_Click(object sender, EventArgs e)
 {
     try
     {
         PurchaseOrderPickForm tiDanForm = new PurchaseOrderPickForm(false);
         tiDanForm.HangedOrderSelected += TiDanForm_HangedOrderSelected;//提单被选择后触发
         tiDanForm.ShowDialog();
     }
     catch (Exception ee)
     {
         GlobalUtil.WriteLog(ee);
     }
 }
Esempio n. 11
0
 private void baseButtonPick_Click(object sender, EventArgs e)
 {
     try
     {
         WholesaleDeliveryPickForm tiDanForm = new WholesaleDeliveryPickForm(true);
         tiDanForm.HangedOrderSelected += TiDanForm_HangedOrderSelected;//提单被选择后触发
         tiDanForm.ShowDialog();
     }
     catch (Exception ee)
     {
         GlobalUtil.WriteLog(ee);
     }
 }
 //当单元格中的金额或折扣值发生变化时,对应修改另一项的值
 private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex > -1 && e.ColumnIndex > -1)
     {
         try
         {
             PfCustomerRetailDetail detail = this.PfCustomerRetailDetailList[e.RowIndex];
             this.dataGridView1.Refresh();
         }
         catch (Exception ex)
         {
             GlobalUtil.WriteLog(ex);
         }
     }
 }
        private void BaseButton_Search_Click(object sender, EventArgs e)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                string memberID  = string.IsNullOrEmpty(this.skinTextBox_MemberID.SkinTxt.Text) ? null : this.skinTextBox_MemberID.SkinTxt.Text;
                string orderID   = string.IsNullOrEmpty(this.skinTextBox_OrderID.SkinTxt.Text) ? null : this.skinTextBox_OrderID.SkinTxt.Text;
                string costumeID = string.IsNullOrEmpty(this.CostumeCurrentShopTextBox1.SkinTxt.Text) ? null : this.CostumeCurrentShopTextBox1.SkinTxt.Text;

                Date startDate = null;
                Date endDate   = null;
                if (this.skinCheckBox1.CheckState == CheckState.Checked)
                {
                    startDate = new Date(this.dateTimePicker_Start.Value);
                    endDate   = new Date(this.dateTimePicker_End.Value);
                }
                this.pagePara = new Core.InteractEntity.RefundListPagePara()
                {
                    CostumeID     = costumeID,
                    RefundOrderID = orderID,
                    MemberID      = memberID,
                    StartDate     = startDate,
                    EndDate       = endDate,
                    PageIndex     = 0,
                    PageSize      = this.dataGridViewPagingSumCtrl.PageSize,
                    ShopID        = GlobalCache.CurrentShopID
                };
                RefundListPage listPage = GlobalCache.ServerProxy.GetRefundListPage(this.pagePara);
                dataGridViewPagingSumCtrl.OrderPara = pagePara;
                this.dataGridViewPagingSumCtrl.Initialize(listPage);
                this.BindingRefundOrderDataSource(listPage);
                #region 清空dataGridView_RetailDetail的绑定源
                this.BindingRefundDetailDataSource(null);
                #endregion
            }
            catch (Exception ee)
            {
                GlobalUtil.WriteLog(ee);
                GlobalMessageBox.Show("查询失败!");
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Esempio n. 14
0
 //点击选择按钮
 private void BaseButton_Select_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.HangedOrderSelected != null)
         {
             this.HangedOrderSelected(curOrder);
         }
         this.DialogResult = DialogResult.OK;
     }
     catch (Exception ee)
     {
         GlobalUtil.WriteLog(ee);
         GlobalMessageBox.Show("选择失败!");
     }
 }
Esempio n. 15
0
        //点击选择按钮
        private void BaseButton_Select_Click(object sender, EventArgs e)
        {
            try
            {
                if (String.IsNullOrEmpty(curOrder.SupplierID) && !String.IsNullOrEmpty(curOrder.SupplierAccountID))
                {
                    SelectSupplierForm form = new SelectSupplierForm();
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        Supplier supplier = form.Result;
                        if (supplier != null)
                        {
                            curOrder.SupplierID = supplier.ID;
                            InteractResult result = GlobalCache.ServerProxy.PurchaseBindingSupplierID(curOrder.ID, curOrder.SupplierID);
                            switch (result.ExeResult)
                            {
                            case ExeResult.Success:
                                this.HangedOrderSelected?.Invoke(curOrder);
                                this.DialogResult = DialogResult.OK;
                                break;

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

                            default:
                                break;
                            }
                        }
                    }
                }
                else
                {
                    this.HangedOrderSelected?.Invoke(curOrder);
                    this.DialogResult = DialogResult.OK;
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.WriteLog(ee);
                GlobalMessageBox.Show("选择失败!");
            }
        }
Esempio n. 16
0
 private void LoadConfig()
 {
     try
     {
         config = BalanceFormConfiguration.Load(CONFIG_PATH) as BalanceFormConfiguration;
     }
     catch (Exception ex)
     {
         GlobalUtil.WriteLog(ex);
     }
     if (config != null)
     {
         this.skinCheckBoxPrint.Checked = config.PrintTicket;
     }
     else
     {
         config = new BalanceFormConfiguration()
         {
         };
     }
 }
Esempio n. 17
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            try
            {
                List <DistributorWithdrawRecord> curScrapOrderListSource = (List <DistributorWithdrawRecord>) this.dataGridView1.DataSource;

                DistributorWithdrawRecord item = curScrapOrderListSource[e.RowIndex];

                if (ColumnPay.Index == e.ColumnIndex)
                {
                    PaymentCashForm payform = new PaymentCashForm(item);

                    if (payform.ShowDialog(this) == DialogResult.OK)
                    {
                        Payment(item);
                    }
                    //  payform.ConfirmClick += Payment(item);

                    // Payment(item);
                    //this.skinSplitContainer1.Panel2Collapsed = false;
                    //this.DetailClick?.Invoke(item, this.skinSplitContainer1.Panel2, false);
                }
                else if (ColumnCancel.Index == e.ColumnIndex)
                {
                    Cancel(item);
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.WriteLog(ex);
            }
        }
Esempio n. 18
0
        /// <summary>
        /// 当输入付款金额后,更新界面上的总计和应付款金额值
        /// </summary>
        private void UpdateMoneyValue()
        {
            try
            {
                this.m_MoneyCash       = String.IsNullOrEmpty(this.skinTextBox_MoneyCash.SkinTxt.Text) ? 0 : decimal.Parse(this.skinTextBox_MoneyCash.SkinTxt.Text);
                this.m_MoneyBankCard   = String.IsNullOrEmpty(this.skinTextBox_MoneyBankCard.SkinTxt.Text) ? 0 : decimal.Parse(this.skinTextBox_MoneyBankCard.SkinTxt.Text);
                this.m_MoneyStoredCard = String.IsNullOrEmpty(this.skinTextBox_MoneyStoredCard.SkinTxt.Text) ? 0 : decimal.Parse(this.skinTextBox_MoneyStoredCard.SkinTxt.Text);
                this.m_MoneyWeiXin     = String.IsNullOrEmpty(this.skinTextBox_MoneyWeiXin.SkinTxt.Text) ? 0 : decimal.Parse(this.skinTextBox_MoneyWeiXin.SkinTxt.Text);
                this.m_MoneyAlipay     = String.IsNullOrEmpty(this.skinTextBox_MoneyAlipay.SkinTxt.Text) ? 0 : decimal.Parse(this.skinTextBox_MoneyAlipay.SkinTxt.Text);
                this.m_MoneyElse       = String.IsNullOrEmpty(this.numericTextBoxElse.SkinTxt.Text) ? 0 : decimal.Parse(this.numericTextBoxElse.SkinTxt.Text);

                this.m_MoneyIntegration = String.IsNullOrEmpty(this.skinTextBox_MoneyIntegration.SkinTxt.Text) ? 0 : decimal.Parse(this.skinTextBox_MoneyIntegration.SkinTxt.Text);
                decimal zongji = this.m_MoneyCash + this.m_MoneyBankCard + this.m_MoneyStoredCard + this.m_MoneyWeiXin + this.m_MoneyAlipay + m_MoneyElse + this.m_MoneyIntegration
                                 + this.discountMoney;
                this.skinLabel_TotalMoney.Text = zongji.ToString();
                this.moneyChange = zongji - this.totalMoneyReceived;
                this.skinLabel_MoneyChange.Text = this.moneyChange.ToString();
            }
            catch (Exception ee)
            {
                GlobalUtil.WriteLog(ee);
                // GlobalMessageBox.Show("输入金额格式不正确");
            }
        }
Esempio n. 19
0
        public void HandleInformation(string sourceUserID, int informationType, byte[] info)
        {
            GlobalUtil.WriteLog("收到通知" + informationType);

            #region 充值规则更改
            if (NoticeInformationTypes.UpdateRechargeDonateRule == informationType)
            {
                RechargeDonateRule rechargeDonateRule = CompactPropertySerializer.Default.Deserialize <RechargeDonateRule>(info, 0);
                GlobalCache.UpdateRechargeDonateRule(rechargeDonateRule);
            }
            else if (NoticeInformationTypes.DeleteRechargeDonateRule == informationType)
            {
                GlobalCache.DeleteRechargeDonateRule();
            }
            else if (NoticeInformationTypes.UpdateShopRechargeRuleID == informationType)
            {
                RechargeDonateRule rechargeDonateRule = CompactPropertySerializer.Default.Deserialize <RechargeDonateRule>(info, 0);
                GlobalCache.UpdateShopRechargeRuleID(rechargeDonateRule);
            }

            #endregion

            #region 系统配置更改

            else if (NoticeInformationTypes.UpdateParameterConfig == informationType)
            {
                ParameterConfig c = CompactPropertySerializer.Default.Deserialize <ParameterConfig>(info, 0);
                GlobalCache.ParameterConfig(c);
            }
            else if (NoticeInformationTypes.UpdateParameterConfigs == informationType)
            {
                List <ParameterConfig> collection = CompactPropertySerializer.Default.Deserialize <List <ParameterConfig> >(info, 0);
                foreach (var item in collection)
                {
                    GlobalCache.ParameterConfig(item);
                }
            }

            #endregion

            #region 导购员信息更改
            else if (NoticeInformationTypes.UpdateGuide == informationType)
            {
                Guide guide = CompactPropertySerializer.Default.Deserialize <Guide>(info, 0);
                GlobalCache.UpdateGuide(guide);
            }
            else if (NoticeInformationTypes.InsertGuide == informationType)
            {
                Guide guide = CompactPropertySerializer.Default.Deserialize <Guide>(info, 0);
                GlobalCache.InsertGuide(guide);
            }
            else if (NoticeInformationTypes.DeleteGuide == informationType)
            {
                string guideID = Encoding.UTF8.GetString(info);
                GlobalCache.DeleteGuide(guideID);
            }
            else if (NoticeInformationTypes.DeleteGuides == informationType)
            {
                List <String> guideIDs = CompactPropertySerializer.Default.Deserialize <List <String> >(info, 0);
                foreach (var guideID in guideIDs)
                {
                    GlobalCache.DeleteGuide(guideID);
                }
            }
            #endregion

            #region 促销活动更改

            else if (NoticeInformationTypes.InsertSalesPromotion == informationType)
            {
                SalesPromotion salesPromotion = CompactPropertySerializer.Default.Deserialize <SalesPromotion>(info, 0);
                GlobalCache.InsertSalesPromotion(salesPromotion);
            }
            else if (NoticeInformationTypes.DeleteSalesPromotion == informationType)
            {
                string salesPromotionID = Encoding.UTF8.GetString(info);
                GlobalCache.DeleteSalesPromotion(salesPromotionID);
            }

            else if (NoticeInformationTypes.UpdateSalesPromotion == informationType)
            {
                SalesPromotion salesPromotion = CompactPropertySerializer.Default.Deserialize <SalesPromotion>(info, 0);
                GlobalCache.UpdateSalesPromotion(salesPromotion);
            }
            #endregion

            #region 品牌配置更改
            else if (NoticeInformationTypes.InsertBrand == informationType)
            {
                Brand brand = CompactPropertySerializer.Default.Deserialize <Brand>(info, 0);
                GlobalCache.InsertBrand(brand);
            }
            else if (NoticeInformationTypes.UpdateBrand == informationType)
            {
                Brand brand = CompactPropertySerializer.Default.Deserialize <Brand>(info, 0);
                GlobalCache.UpdateBrand(brand);
            }
            else if (NoticeInformationTypes.DeleteBrand == informationType)
            {
                int brandID = BitConverter.ToInt32(info, 0);
                GlobalCache.DeleteBrand(brandID);
            }
            #endregion

            #region  装信息更改

            //新增服装
            else if (NoticeInformationTypes.InsertCostume == informationType)
            {
                Costume costume = CompactPropertySerializer.Default.Deserialize <Costume>(info, 0);
                GlobalCache.InsertCostume(costume);
            }
            //服装信息更改
            else if (NoticeInformationTypes.UpdateCostume == informationType)
            {
                Costume costume = CompactPropertySerializer.Default.Deserialize <Costume>(info, 0);
                GlobalCache.UpdateCostume(costume);
            }
            else if (NoticeInformationTypes.DeleteCostume == informationType)
            {
                string costumeID = Encoding.UTF8.GetString(info);
                GlobalCache.DeleteCostume(costumeID);
            }
            else if (NoticeInformationTypes.InsertCostumes == informationType)
            {
                List <Costume> costumes = CompactPropertySerializer.Default.Deserialize <List <Costume> >(info, 0);
                foreach (var costume in costumes)
                {
                    GlobalCache.InsertCostume(costume);
                }
            }
            else if (NoticeInformationTypes.UpdateCostumes == informationType)
            {
                List <Costume> costumes = CompactPropertySerializer.Default.Deserialize <List <Costume> >(info, 0);
                foreach (var costume in costumes)
                {
                    GlobalCache.UpdateCostume(costume);
                }
            }
            else if (NoticeInformationTypes.UpdateCostumeValid == informationType)
            {
                UpdateCostumeValidPara result = CompactPropertySerializer.Default.Deserialize <UpdateCostumeValidPara>(info, 0);
                GlobalCache.UpdateCostumeValid(result);
            }
            else if (NoticeInformationTypes.InsertCostumeStores == informationType)
            {
                GlobalCache.LoadCostumeInfos();
            }

            #endregion

            #region 管理员信息更改
            //新增管理员
            else if (NoticeInformationTypes.InsertAdminUser == informationType)
            {
                AdminUser adminUser = CompactPropertySerializer.Default.Deserialize <AdminUser>(info, 0);
                GlobalCache.InsertAdminUser(adminUser);
            }
            //管理员信息更改
            else if (NoticeInformationTypes.UpdateAdminUser == informationType)
            {
                AdminUser adminUser = CompactPropertySerializer.Default.Deserialize <AdminUser>(info, 0);
                GlobalCache.UpdateAdminUser(adminUser);
            }
            #endregion

            #region 供应商信息更改
            //新增供应商
            else if (NoticeInformationTypes.InsertSupplier == informationType)
            {
                Supplier supplier = CompactPropertySerializer.Default.Deserialize <Supplier>(info, 0);
                GlobalCache.InsertSupplier(supplier);
            }
            else if (NoticeInformationTypes.ImportSupplier == informationType)
            {
                List <Supplier> suppliers = CompactPropertySerializer.Default.Deserialize <List <Supplier> >(info, 0);
                if (suppliers != null)
                {
                    foreach (var supplier in suppliers)
                    {
                        GlobalCache.InsertSupplier(supplier);
                    }
                }
            }
            //供应商信息更改
            else if (NoticeInformationTypes.UpdateSupplier == informationType)
            {
                Supplier supplier = CompactPropertySerializer.Default.Deserialize <Supplier>(info, 0);
                GlobalCache.UpdateSupplier(supplier);
            }
            //删除供应商
            else if (NoticeInformationTypes.DeleteSupplier == informationType)
            {
                string supplierID = Encoding.UTF8.GetString(info);
                GlobalCache.DeleteSupplier(supplierID);
            }
            #endregion

            #region 店铺更改
            //新增店铺
            else if (NoticeInformationTypes.InsertShop == informationType)
            {
                Shop shop = CompactPropertySerializer.Default.Deserialize <Shop>(info, 0);
                GlobalCache.InsertShop(shop);
            }
            //店铺信息更改
            else if (NoticeInformationTypes.UpdateShop == informationType)
            {
                Shop shop = CompactPropertySerializer.Default.Deserialize <Shop>(info, 0);
                GlobalCache.UpdateShop(shop);
            }
            else if (NoticeInformationTypes.DisableShop == informationType)
            {
                String shopID = Encoding.UTF8.GetString(info);
                GlobalCache.DisableShop(shopID);
            }
            else if (NoticeInformationTypes.DeleteShop == informationType)
            {
                String shopID = Encoding.UTF8.GetString(info);
                GlobalCache.RemoveShop(shopID);
            }
            //Todo:

            #endregion
            else if (NoticeInformationTypes.InsertDifferenceOrder == informationType)
            {
                int result = SerializeHelper.ByteArrayToInt(info);

                DifferenceOrderPagePara checkOrderPagePara = new DifferenceOrderPagePara()
                {
                    OrderID                  = null,
                    CostumeID                = null,
                    IsOpenDate               = true,
                    IsOnlyGetOut             = true,
                    StartDate                = new CJBasic.Date("1900-01-01"),
                    EndDate                  = new CJBasic.Date(DateTime.Now),
                    PageIndex                = 0,
                    PageSize                 = 1000,
                    ShopID                   = CommonGlobalCache.CurrentShopID,
                    OrderPrefixType          = ValidateUtil.CheckEmptyValue(OrderPrefix.AllocateOrder),
                    DifferenceOrderConfirmed = DifferenceOrderConfirmed.False,
                };

                DifferenceOrderPage checkOrderListPage = CommonGlobalCache.ServerProxy.GetDifferenceOrderPage(checkOrderPagePara);

                ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + checkOrderListPage.DifferenceOrderList.Count + "张差异单待处理,请及时处理!" + "#" + informationType);
            }
            #region 新的补货申请单待处理通知
            else if (NoticeInformationTypes.ReplenishOutbound == informationType)
            {
                ReplenishCostumePagePara pageParaReplenish = new ReplenishCostumePagePara()
                {
                    CostumeID           = null,
                    ReplenishOrderID    = null,
                    IsOpenDate          = true,
                    StartDate           = new CJBasic.Date("1900-01-01"),
                    EndDate             = new CJBasic.Date(DateTime.Now),
                    PageIndex           = 0,
                    PageSize            = 10000,
                    ShopID              = CommonGlobalCache.CurrentShopID,
                    ReplenishOrderState = ReplenishOrderState.NotProcessing,
                    BrandID             = -1
                };
                ReplenishCostumePage listPageReplenish = CommonGlobalCache.ServerProxy.GetReplenishCostumePage(pageParaReplenish);

                ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + listPageReplenish.ReplenishOrderList.Count + "张待发货的补货申请单待处理,请及时处理!" + "#" + informationType);
            }
            else if (NoticeInformationTypes.AllocateOutbound == informationType)
            {
                int result = SerializeHelper.ByteArrayToInt(info);
                if (GlobalCache.GetParameter(ParameterConfigKey.AllocateInDirectly)?.ParaValue == "1")
                {
                    ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有新的调拨单已入库!");
                }
                else
                {
                    GetAllocateOrdersPara pagePara = new GetAllocateOrdersPara()
                    {
                        AllocateOrderID    = null,
                        AllocateOrderState = AllocateOrderState.Normal,
                        CostumeID          = null,
                        EndDate            = new CJBasic.Date(DateTime.Now),
                        StartDate          = new CJBasic.Date("1900-01-01"),
                        ShopID             = "",
                        Type         = AllocateOrderType.All,
                        PageIndex    = 0,
                        PageSize     = 20,
                        ReceiptState = ReceiptState.WaitReceipt,
                        LockShop     = PermissonUtil.HasPermission(RolePermissionMenuEnum.调拨单查询, RolePermissionEnum.查看_只看本店),
                        DestShopID   = CommonGlobalCache.CurrentShopID,
                        SourceShopID = "",
                    };

                    InteractResult <AllocateOrderPage> listPage = CommonGlobalCache.ServerProxy.GetAllocateOrders(pagePara);
                    ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + listPage.Data.AllocateOrderList.Count + "张调拨单待处理,请及时处理!" + "#" + informationType);
                }
            }
            else if (NoticeInformationTypes.ReplenishCostume == informationType)
            {
                int result = SerializeHelper.ByteArrayToInt(info);
                ReplenishCostumePagePara pageParaReplenish = new ReplenishCostumePagePara()
                {
                    CostumeID           = null,
                    ReplenishOrderID    = null,
                    IsOpenDate          = true,
                    StartDate           = new CJBasic.Date("1900-01-01"),
                    EndDate             = new CJBasic.Date(DateTime.Now),
                    PageIndex           = 0,
                    PageSize            = 10000,
                    ShopID              = CommonGlobalCache.CurrentShopID,
                    ReplenishOrderState = ReplenishOrderState.NotProcessing,
                    BrandID             = -1
                };
                ReplenishCostumePage listPageReplenish = CommonGlobalCache.ServerProxy.GetReplenishCostumePage(pageParaReplenish);

                ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有补货申请单待处理,请及时处理!" + "#" + informationType);
            }
            #endregion
            #region 盘点已审核通知
            else if (NoticeInformationTypes.CheckStorePass == informationType)
            {
                GlobalUtil.WriteLog("盘点已审核通知");
                ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您的盘点单已审核,请及时查收!" + "#" + informationType);
                // GlobalUtil.MainForm.OnStoreStateChanged(false);
            }
            #endregion
            #region 盘点退回通知

            /*  else if (NoticeInformationTypes.CancelCheckStore == informationType)
             * {
             *    GlobalUtil.WriteLog("盘点退回通知");
             *    ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您的盘点单被退回,请及时查收!" + "#" + informationType);
             *
             * } */
            #endregion
            #region 补货申请单/调拨单冲单通知
            else if (NoticeInformationTypes.OverrideOrder == informationType)
            {
                string result = String.Empty;
                if (info != null)
                {
                    result = Encoding.UTF8.GetString(info);
                }
                GlobalUtil.WriteLog("补货申请单/或调拨单" + result + "冲单通知");

                ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您的" + GlobalUtil.OrderType(result) + "单" + result + "被冲单,请及时查收!" + "#" + informationType);
            }
            #endregion
            #region 补货申请单取消
            else if (NoticeInformationTypes.CancelReplenish == informationType)
            {
                string result = String.Empty;
                if (info != null)
                {
                    result = Encoding.UTF8.GetString(info);
                }
                GlobalUtil.WriteLog("补货申请单" + result + "取消通知");

                ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您的" + GlobalUtil.OrderType(result) + "单" + result + "被取消,请及时查收!" + "#" + informationType);
            }
            #endregion
            else if (NoticeInformationTypes.NewEmRefundOrder == informationType)
            {
                int result = SerializeHelper.ByteArrayToInt(info);

                GetEmOrderPagePara EmReturnpagePara = new GetEmOrderPagePara()
                {
                    OrderID           = null,
                    StartDate         = new CJBasic.Date("1900-01-01"),
                    EndDate           = new CJBasic.Date(DateTime.Now),
                    PageIndex         = 0,
                    PageSize          = 1000,
                    MemberPhoneOrName = null,
                    CostumeIDOrName   = null,
                    OrderState        = EmRetailOrderState.All,

                    RefundStatus = RefundStatus.Refunding,
                };

                EmOrderPage EmReturnlistPage = CommonGlobalCache.ServerProxy.GetEmOrderPage(EmReturnpagePara);

                int rows = EmReturnlistPage.ResultList.FindAll(t => t.RefundStateName == EmRetailOrder.GetRefundState(RefundStateEnum.RefundApplication) || t.RefundStateName == EmRetailOrder.GetRefundState(RefundStateEnum.Refunding)).Count;

                ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + rows + "张线上退货待处理,请及时处理!" + "#" + informationType);
            }
            else if (NoticeInformationTypes.NewEmRetailOrder == informationType)
            {
                int result = SerializeHelper.ByteArrayToInt(info);
                GetEmOrderPagePara EmpagePara = new GetEmOrderPagePara()
                {
                    OrderID           = null,
                    StartDate         = new CJBasic.Date("1900-01-01"),
                    EndDate           = new CJBasic.Date(DateTime.Now),
                    PageIndex         = 0,
                    PageSize          = 1000,
                    MemberPhoneOrName = null,
                    CostumeIDOrName   = null,
                    OrderState        = EmRetailOrderState.WaitDelivery,
                    RefundStatus      = RefundStatus.NotSelect,
                };

                EmOrderPage EmlistPage = CommonGlobalCache.ServerProxy.GetEmOrderPage(EmpagePara);

                ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + EmlistPage.ResultList.Count + "张线上订单待处理,请及时处理!" + "#" + informationType);
            }
            #region 批发客户信息更改
            //新增供应商
            else if (NoticeInformationTypes.InsertPfCustomer == informationType)
            {
                PfCustomer supplier = CompactPropertySerializer.Default.Deserialize <PfCustomer>(info, 0);
                PfCustomerCache.InsertPfCustomer(supplier);
            }
            else if (NoticeInformationTypes.ImportPfCustomer == informationType)
            {
                List <PfCustomer> suppliers = CompactPropertySerializer.Default.Deserialize <List <PfCustomer> >(info, 0);
                foreach (var supplier in suppliers)
                {
                    PfCustomerCache.InsertPfCustomer(supplier);
                }
            }
            //供应商信息更改
            else if (NoticeInformationTypes.UpdatePfCustomer == informationType)
            {
                PfCustomer supplier = CompactPropertySerializer.Default.Deserialize <PfCustomer>(info, 0);
                PfCustomerCache.UpdatePfCustomer(supplier);
            }
            //删除供应商
            else if (NoticeInformationTypes.DeletePfCustomer == informationType)
            {
                string supplierID = Encoding.UTF8.GetString(info);
                PfCustomerCache.DeletePfCustomer(supplierID);
            }
            #endregion
            #region 盘点待处理通知
            else if (NoticeInformationTypes.InsertCheckStore == informationType)
            {
                GlobalUtil.WriteLog("盘点待处理通知");
                CheckStoreOrderPagePara checkPagePara = new CheckStoreOrderPagePara()
                {
                    CheckStoreOrderID = null,
                    IsOpenDate        = true,
                    StartDate         = new CJBasic.Date("1900-01-01"),
                    EndDate           = new CJBasic.Date(DateTime.Now),
                    PageIndex         = 0,
                    PageSize          = 1000,
                    //ShopID = CommonGlobalCache.CurrentShopID,
                    CostumeID = null,
                    State     = CheckStoreOrderState.PendingReview,
                };

                CheckStoreOrderPage ChecklistPage = CommonGlobalCache.ServerProxy.GetCheckStoreOrderPage(checkPagePara);

                ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有" + ChecklistPage.CheckStoreOrderList.Count + "张盘点单待审核,请及时处理!" + "#" + informationType);
            }
            #endregion
            #region 盘点退回通知
            else if (NoticeInformationTypes.CancelCheckStore == informationType)
            {
                GlobalUtil.WriteLog("盘点退回通知");
                ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您的盘点单被退回,请及时处理!" + "#" + informationType);
            }
            #endregion
            #region 盘点取消通知
            else if (NoticeInformationTypes.CancelCheckStoreTask == informationType)
            {
                GlobalUtil.WriteLog("盘点取消通知");
                ((MainForm)GlobalUtil.MainForm).OnNewInfomation("您有盘点已取消!");
            }
            #endregion
            else if (NoticeInformationTypes.EnabledSizeGroup == informationType)
            {
                EnabledSizeGroupPara sizeGroup = CompactPropertySerializer.Default.Deserialize <EnabledSizeGroupPara>(info, 0);
                GlobalCache.EnabledSizeGroup(sizeGroup);
            }
            else if (NoticeInformationTypes.InsertSizeGroup == informationType)
            {
                SizeGroup sizeGroup = CompactPropertySerializer.Default.Deserialize <SizeGroup>(info, 0);
                GlobalCache.InsertSizeGroup(sizeGroup);
            }
            else if (NoticeInformationTypes.UpdateSizeGroup == informationType)
            {
                SizeGroup sizeGroup = CompactPropertySerializer.Default.Deserialize <SizeGroup>(info, 0);
                GlobalCache.UpdateSizeGroup(sizeGroup);
            }
            else if (NoticeInformationTypes.DeleteSizeGroup == informationType)
            {
                String SizeGroupName = Encoding.UTF8.GetString(info);
                GlobalCache.DeleteSizeGroup(SizeGroupName);
            }
            else if (NoticeInformationTypes.UpdateSizeNames == informationType)
            {
                UpdateSizeNamesInfo sizeNameInfo = CompactPropertySerializer.Default.Deserialize <UpdateSizeNamesInfo>(info, 0);
                GlobalCache.UpdateSizeNames(sizeNameInfo);
            }
            else if (NoticeInformationTypes.InsertDistributor == informationType)
            {
                Distributor supplier = CompactPropertySerializer.Default.Deserialize <Distributor>(info, 0);
                GlobalCache.InsertDistributor(supplier);
            }
            else if (NoticeInformationTypes.UpdateDistributor == informationType)
            {
                Distributor supplier = CompactPropertySerializer.Default.Deserialize <Distributor>(info, 0);
                GlobalCache.UpdateDistributor(supplier);
            }
            #region 批发客户信息更改
            //新增供应商
            else if (NoticeInformationTypes.InsertPfCustomer == informationType)
            {
                PfCustomer supplier = CompactPropertySerializer.Default.Deserialize <PfCustomer>(info, 0);
                PfCustomerCache.InsertPfCustomer(supplier);
            }
            //供应商信息更改
            else if (NoticeInformationTypes.UpdatePfCustomer == informationType)
            {
                PfCustomer supplier = CompactPropertySerializer.Default.Deserialize <PfCustomer>(info, 0);
                PfCustomerCache.UpdatePfCustomer(supplier);
            }
            //删除供应商
            else if (NoticeInformationTypes.DeletePfCustomer == informationType)
            {
                string supplierID = Encoding.UTF8.GetString(info);
                PfCustomerCache.DeletePfCustomer(supplierID);
            }
            else if (NoticeInformationTypes.SendAnnounce == informationType)
            {
                int      result   = SerializeHelper.ByteArrayToInt(info);
                Announce announce = CompactPropertySerializer.Default.Deserialize <Announce>(info, 0);
                //1:发布中,2:已完成,3:已取消
                AnnounceState state = (AnnounceState)announce.State;

                switch (state)
                {
                case AnnounceState.Finished:
                case AnnounceState.Cancel:
                    ((MainForm)GlobalUtil.MainForm).SendAnnounce(state);
                    break;

                case AnnounceState.Releasing:
                    CommonGlobalCache.SystemUpdateMessage = announce.AnnounceContent;
                    ((MainForm)GlobalUtil.MainForm).OnNewInfomation("系统升级公告\r\n尊敬的客户:\r\n" + announce.AnnounceContent);
                    ((MainForm)GlobalUtil.MainForm).SendAnnounce(state);
                    break;

                default:
                    break;
                }
            }
            else if (NoticeInformationTypes.NoticeClose == informationType)
            {
                ((MainForm)GlobalUtil.MainForm).DoClose();
                //  System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location);
            }
            #endregion
        }
Esempio n. 20
0
        private void BaseButton_OK_Click(object sender, EventArgs e)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                if (this.refundCostume.RefundOrder.TotalCount == 0)
                {
                    GlobalMessageBox.Show("退货数量为0,不能退货");
                    return;
                }

                if (Math.Abs(skinLabel_TotalMoney.Value) != (skinLabel_RefundIntegration.Value + skinLabel_RefundStoredCard.Value + skinLabel_RefundCash.Value +
                                                             this.numericTextBoxBankCard.Value +
                                                             this.numericTextBoxWeixin.Value +
                                                             this.numericTextBoxAlipay.Value +
                                                             this.numericTextBoxElse.Value
                                                             ))
                {
                    GlobalMessageBox.Show("退款总额必须与总计相等!");
                    return;
                }


                this.refundCostume.RefundOrder.MoneyIntegration = skinLabel_RefundIntegration.Value * -1;
                this.refundCostume.RefundOrder.MoneyVipCard     = skinLabel_RefundStoredCard.Value * -1;
                this.refundCostume.RefundOrder.MoneyCash        = skinLabel_RefundCash.Value * -1;
                this.refundCostume.RefundOrder.MoneyAlipay      = numericTextBoxAlipay.Value * -1;
                this.refundCostume.RefundOrder.MoneyOther       = numericTextBoxElse.Value * -1;
                this.refundCostume.RefundOrder.MoneyWeiXin      = numericTextBoxWeixin.Value * -1;
                this.refundCostume.RefundOrder.MoneyBankCard    = numericTextBoxBankCard.Value * -1;
                //  decimal moneyVipCardDonate = this.refundCostume.RefundOrder.MoneyVipCard * (decimal)member.DonateCoef;
                //  decimal moneyVipCardMain = this.refundCostume.RefundOrder.MoneyVipCard * (1 - (decimal)member.DonateCoef);
                if (!String.IsNullOrEmpty(refundCostume.RefundOrder.MemeberID))
                {
                    Member member = CommonGlobalCache.ServerProxy.GetOneMember(refundCostume.RefundOrder.MemeberID);
                    if (member != null)
                    {
                        decimal moneyVipCardMain = refundCostume.RefundOrder.MoneyVipCard * (decimal)(1.0 - member.DonateCoef);
                        refundCostume.RefundOrder.MoneyCash2         = refundCostume.RefundOrder.MoneyCash;
                        refundCostume.RefundOrder.MoneyVipCardMain   = moneyVipCardMain;
                        refundCostume.RefundOrder.MoneyVipCardDonate = refundCostume.RefundOrder.MoneyVipCard * (decimal)(member.DonateCoef);
                    }
                }
                else
                {
                    refundCostume.RefundOrder.MoneyCash2         = refundCostume.RefundOrder.MoneyCash;
                    refundCostume.RefundOrder.MoneyVipCardMain   = 0;
                    refundCostume.RefundOrder.MoneyVipCardDonate = 0;
                }
                if (refundCostume.RefundOrder.IsNotPay)
                {
                    decimal total = 0;
                    foreach (RetailDetail curDetail in this.refundCostume.RefundDetailList)
                    {
                        foreach (RetailDetail keepDetail in keepCostume.RefundDetailList)
                        {
                            if (curDetail.RetailOrderID == keepDetail.RetailOrderID && curDetail.CostumeID == keepDetail.CostumeID && curDetail.ColorName == keepDetail.ColorName && curDetail.SizeName == keepDetail.SizeName)
                            {
                                curDetail.SumMoney = keepDetail.SumMoney;
                                total += keepDetail.SumMoney;
                            }
                        }
                    }

                    refundCostume.RefundOrder.TotalMoneyReceived = total * -1;
                }
                else
                {
                    //总计=现金+积分+VIP卡+优惠券
                    //这笔单的应收金额 - (不退的那几件以原价* 数量 -满减金额) - (退的那几件)优惠券
                    refundCostume.RefundOrder.TotalMoneyReceived = refundCostume.RefundOrder.MoneyCash + refundCostume.RefundOrder.MoneyIntegration + refundCostume.RefundOrder.MoneyVipCard
                                                                   + this.refundCostume.RefundOrder.MoneyAlipay + this.refundCostume.RefundOrder.MoneyOther +
                                                                   this.refundCostume.RefundOrder.MoneyWeiXin +
                                                                   this.refundCostume.RefundOrder.MoneyBankCard;
                    refundCostume.RefundOrder.TotalMoneyReceivedActual = refundCostume.RefundOrder.MoneyCash
                                                                         + this.refundCostume.RefundOrder.MoneyAlipay + this.refundCostume.RefundOrder.MoneyOther +
                                                                         this.refundCostume.RefundOrder.MoneyWeiXin +
                                                                         this.refundCostume.RefundOrder.MoneyBankCard
                                                                         + refundCostume.RefundOrder.MoneyVipCardMain + (refundCostume.RefundOrder.RetailMoneyDeductedByTicket - refundCostume.RefundOrder.MoneyDeductedByTicket);
                    refundCostume.RefundOrder.Benefit = refundCostume.RefundOrder.TotalMoneyReceivedActual - refundCostume.RefundOrder.TotalCost;



                    //平摊
                    if (refundCostume.RefundDetailList != null)
                    {
                        CalcDirectly();
                    }

                    //总计=现金+积分+VIP卡+优惠券
                    //这笔单的应收金额 - (不退的那几件以原价* 数量 -满减金额) - (退的那几件)优惠券
                    //  refundCostume.RefundOrder.TotalMoneyReceived = refundCostume.RefundOrder.MoneyCash + refundCostume.RefundOrder.MoneyIntegration + refundCostume.RefundOrder.MoneyVipCard;
                }

                refundCostume.RefundOrder.ShopID = this.ShopID;
                InteractResult result = GlobalCache.ServerProxy.RefundCostume(this.refundCostume);

                if (result.ExeResult == ExeResult.Success)
                {
                    GlobalMessageBox.Show("退货成功!");
                    this.DialogResult = DialogResult.OK;
                    if (skinCheckBoxPrint.Checked)
                    {
                        RefundOrderPrintUtil printHelper = new RefundOrderPrintUtil();
                        int          times = CommonGlobalUtil.ConvertToInt32(CommonGlobalCache.GetParameter(ParameterConfigKey.PrintCount).ParaValue);
                        DataGridView dgv   = deepCopyDataGridView();
                        printHelper.Print(refundCostume, times, dgv);
                    }
                }
                else if (result.ExeResult == ExeResult.Error)
                {
                    GlobalMessageBox.Show(result.Msg);
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.WriteLog(ee);
                GlobalMessageBox.Show("内部错误,退货失败!");
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Esempio n. 21
0
        private void RetailOrderIDTextBox1_OrderSelected(RetailOrder retailOrder)
        {
            try
            {
                if (retailOrder == null)
                {
                    return;
                }
                this.retailOrderIDTextBox1.SkinTxt.Text = retailOrder.ID;
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                this.originalRetailCostume = GlobalCache.ServerProxy.GetOneRetailCostume(retailOrder.ID);
                if (this.originalRetailCostume == null)
                {
                    return;
                }
                this.currentRetailCostume = this.originalRetailCostume;
                RetailOrder order = this.currentRetailCostume.RetailOrder;
                foreach (RetailDetail detail in this.currentRetailCostume.RetailDetailList)
                {
                    detail.IsRefund    = true;
                    detail.RefundCount = detail.BuyCount;
                }
                #region 设置标签信息
                Member member = GlobalCache.ServerProxy.GetOneMember(order.MemeberID);
                if (member != null)
                {
                    this.skinLabel_MemberName.Text = member.Name;
                }
                else
                {
                    this.skinLabel_MemberName.Text = "";
                }
                this.skinLabel_MemberID.Text = order.MemeberID;
                this.skinLabel_GuideID.Text  = GlobalCache.GetUserName(order.GuideID);
                // SalesPromotion salesPromotion = GlobalCache.ServerProxy.GetOneSalesPromotion(order.SalesPromotionID);
                //  if (salesPromotion != null)
                // {
                //  this.skinLabel_SalesPromotion.Text = salesPromotion.Name;
                // }
                // else
                //  {
                //   this.skinLabel_SalesPromotion.Text = "";
                // }
                this.skinLabel_SalesPromotion.Text = order.PromotionText;

                this.skinLabel_MoneyIntegration.Text   = order.MoneyIntegration.ToString();
                this.skinLabel_MoneyStoredCard.Text    = order.MoneyVipCard.ToString();
                this.skinLabel_TotalMoneyReceived.Text = order.TotalMoneyReceived.ToString();
                skinLabel_SmallMoneyRemoved.Text       = retailOrder.SmallMoneyRemoved.ToString();
                this.skinLabel_MoneyCash.Text          = retailOrder.MoneyCash.ToString();
                this.skinLabel_MoneyStoredCard.Text    = retailOrder.MoneyVipCard.ToString();
                this.skinLabel_MoneyBankCard.Text      = retailOrder.MoneyBankCard.ToString();
                this.skinLabel_MoneyWeiXin.Text        = retailOrder.MoneyWeiXin.ToString();
                this.skinLabel_MoneyAlipay.Text        = retailOrder.MoneyAlipay.ToString();
                this.skinLabelOther.Text        = retailOrder.MoneyOther.ToString();
                this.skinLabel_MoneyChange.Text = retailOrder.MoneyChange.ToString();
                this.skinLabelGiftTicket.Text   = retailOrder.MoneyDeductedByTicket.ToString();
                skinLabel_remark.Text           = retailOrder.Remarks;

                #endregion

                #region 绑定数据源
                this.BindingRetailCostumeSource();
                #endregion
            }
            catch (Exception ee)
            {
                GlobalUtil.WriteLog(ee);
                GlobalMessageBox.Show("查询失败!");
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Esempio n. 22
0
        private Boolean  ConnectToServer(Boolean isFirstTime)
        {
            try
            {
                this.ShowConnectingMessage("验证登录中……");


                //如果连不上?重新获取服务器连接
                passiveEngine.SystemToken = SystemToken.Manage + "#" + this.skinTextBoxBusinessAccount.Text + "#" + skinLabelVersion.Text;
                //if (!GlobalUtil.IPAndPort(new IPEndPoint(IPAddress.Parse(config.BusinessAccount.ServerIP), config.BusinessAccount.ServerPort)))
                //{
                //    GlobalMessageBox.Show("连接不到服务地址,请联系客服!");
                //    return false;
                //}
                //  CommonGlobalUtil.WriteLog(this.skinTextBoxUser.Text + "," + skinTextBoxPwd.Text + "," + config.BusinessAccount.ServerIP + "," + config.BusinessAccount.ServerPort);
                String        pwdMd5 = SecurityHelper.MD5String2(this.skinTextBoxPwd.Text);
                LogonResponse result = this.passiveEngine.Initialize(this.skinTextBoxUser.Text.ToLower(), pwdMd5, config.BusinessAccount.ServerIP, config.BusinessAccount.ServerPort, new CustomizeHandler());
                switch (result.LogonResult)
                {
                case LogonResult.Succeed:

                    LoginInfo info = new LoginInfo();
                    info.LastLoginID  = this.skinTextBoxUser.Text.ToLower();
                    info.SavePassword = this.skinCheckBoxSavePwd.Checked;
                    if (info.SavePassword)
                    {
                        info.Password = this.skinTextBoxPwd.Text;
                    }
                    else
                    {
                        info.Password = null;
                    }


                    info.loginTime = DateTime.Now;
                    LoginInfo orgInfo = config.LoginInfos.Find(t => t.LastLoginID.ToLower() == info.LastLoginID.ToLower());
                    if (orgInfo != null)
                    {
                        config.LoginInfos.Remove(orgInfo);
                    }

                    config.LoginInfos.Insert(0, info);
                    config.Save(CONFIG_PATH);

                    CommonGlobalCache.SetBusinessAccount(config.BusinessAccount);
                    this.UpdateDialogResult();
                    if (!String.IsNullOrEmpty(result.FailureCause))
                    {
                        ShowDialogMessage(result.FailureCause);
                        CommonGlobalCache.SystemUpdateMessage = result.FailureCause;
                    }
                    break;

                case LogonResult.Failed:
                    this.ShowConnectingMessage(result.FailureCause, true);
                    break;

                case LogonResult.HadLoggedOn:
                    this.ShowConnectingMessage("该帐号已经在其它地方登录!", true);
                    break;

                case LogonResult.VersionMismatched:
                    this.ShowConnectingMessage("客户端与服务器的CJFramework版本不一致!", true);
                    break;

                default:
                    break;
                }
            }
            catch (SocketException ex)
            {
                if (!isFirstTime)
                {
                    GlobalUtil.WriteLog(ex + "!isFirstTime1 ERROR Message=" + ex.Message + "Exception StackTrace=" + ex.StackTrace);
                    this.ShowConnectingMessage("连接不到服务端,请联系客服!", true);
                }
                else
                {
                    GlobalUtil.WriteLog(ex + "1ERROR Message=" + ex.Message + "Exception StackTrace=" + ex.StackTrace); return(false);
                }
            }
            catch (Exception ex)
            {
                if (!isFirstTime)
                {
                    this.ShowConnectingMessage("系统异常" + ex.Message, true);
                    GlobalUtil.WriteLog(ex + "!isFirstTime2 ERROR Message=" + ex.Message + "Exception StackTrace=" + ex.StackTrace);
                }
                else
                {
                    GlobalUtil.WriteLog(ex + "2ERROR Message=" + ex.Message + "Exception StackTrace=" + ex.StackTrace); return(false);
                }
            }
            return(true);
        }
Esempio n. 23
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                decimal moneyCash = decimal.Parse(this.skinTextBox_MoneyCash.SkinTxt.Text);
                if (moneyCash <= 0)
                {
                    GlobalMessageBox.Show("输入的金额必须大于0!");
                    return;
                }
                else
                {
                    if (moneyCash > Convert.ToDecimal(99999999.99))
                    {
                        GlobalMessageBox.Show("输入的金额不能大于99999999.99!");
                        return;
                    }
                }
                //if (this.guideComboBox1.SelectedIndex == 0)
                //{
                //    GlobalMessageBox.Show("操作人不能为空");
                //    return;
                //}

                CashRecordFeeType feeType = (CashRecordFeeType)(this.skinComboBox_FeeType.SelectedValue);

                if (feeType != CashRecordFeeType.Income)
                {
                    moneyCash = moneyCash * -1;
                }
                CashRecord cashRecord = new CashRecord()
                {
                    ShopID         = GlobalCache.CurrentShopID,
                    FeeType        = (byte)feeType,
                    FeeDetailType  = this.skinComboBox_FeeDetailType.SelectedValue.ToString(),
                    MoneyCash      = moneyCash,
                    Remarks        = this.skinTextBox_Remarks.SkinTxt.Text.Trim(),
                    CreateTime     = DateTime.Now,
                    OperatorUserID = CommonGlobalCache.CurrentUserID //(string)this.guideComboBox1.SelectedValue,
                };
                InsertResult result = GlobalCache.ServerProxy.InsertCashRecord(cashRecord);
                switch (result)
                {
                case InsertResult.Success:
                    GlobalMessageBox.Show("新增成功!");

                    TabPageClose(this.CurrentTabPage, this.SourceCtrlType);
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.WriteLog(ee);
                GlobalMessageBox.Show("新增失败!");
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }