Exemple #1
0
        private void ShowForm(PfCustomerRetailOrder order)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                CustomerSaleOrderDetailForm form = new  CustomerSaleOrderDetailForm();
                form.ShowDialog(order);

                /*  if (order.Type == "调拨")
                 * {
                 *    //采购进货明细
                 *    CostumeStoreTrackSearchTurnOutDetailForm form
                 *         = new CostumeStoreTrackSearchTurnOutDetailForm();
                 *    form.BaseModifyCostumeID = para.CostumeID;
                 *  //  form.ShowDialog(order);
                 * }
                 * else
                 * {
                 *    CostumeStoreTrackSearchTurnOutDetailWholeSaleForm form = new CostumeStoreTrackSearchTurnOutDetailWholeSaleForm();
                 *    form.BaseModifyCostumeID = para.CostumeID;
                 *    form.ShowDialog(order);
                 * }*/
            }
            catch (Exception ex)
            {
                ShowError(ex);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #2
0
 private void BaseButton_Search_Click(object sender, EventArgs e)
 {
     try
     {
         if (CommonGlobalUtil.EngineUnconnectioned(this))
         {
             return;
         }
         string orderID = string.IsNullOrEmpty(this.skinTextBox_OrderID.SkinTxt.Text) ? null : this.skinTextBox_OrderID.SkinTxt.Text;
         this.pagePara = new ReplenishCostumePagePara()
         {
             CostumeID           = costumeTextBox1.Text,
             ReplenishOrderID    = orderID,
             IsOpenDate          = this.isOpenDate,
             StartDate           = new CJBasic.Date(this.dateTimePicker_Start.Value),
             EndDate             = new CJBasic.Date(this.dateTimePicker_End.Value),
             PageIndex           = 0,
             PageSize            = this.dataGridViewPagingSumCtrl.PageSize,
             ShopID              = shopID,
             ReplenishOrderState = (ReplenishOrderState)this.skinComboBoxState.SelectedValue,
             BrandID             = -1
         };
         ReplenishCostumePage listPage = CommonGlobalCache.ServerProxy.GetReplenishCostumePage(this.pagePara);
         dataGridViewPagingSumCtrl.OrderPara = pagePara;
         this.dataGridViewPagingSumCtrl.Initialize(listPage);
         this.BindingReplenishOrderSource(listPage);
     }
     catch (Exception ee)
     {
         ShowError(ee);
     }
     finally
     {
         UnLockPage();
     }
 }
Exemple #3
0
        private void ShowForm(PurchaseOrder order)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                /*   CostumeInDetailForm form = new CostumeInDetailForm();
                 *
                 * form.BaseModifyCostumeID = para.CostumeID;
                 * // PurchaseOrder changeOrder = CommonGlobalCache.ServerProxy.GetOnePurchaseOrder(order.ID);
                 * form.ShowDialog(order);*/
            }
            catch (Exception ex)
            {
                ShowError(ex);
            }
            finally
            {
                UnLockPage();
            }
        }
        private void DoEnable(GiftTicket item)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                EnabledGiftTicketPara para = new EnabledGiftTicketPara()
                {
                    Enabled = item.Enabled,
                    ID      = item.ID
                };
                UpdateResult result = CommonGlobalCache.ServerProxy.EnabledGiftTicket(para);
                switch (result)
                {
                case UpdateResult.Success:
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #5
0
        private void BaseButton_Search_Click(object sender, EventArgs e)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                string orderID   = string.IsNullOrEmpty(this.skinTextBox_OrderID.SkinTxt.Text) ? null : this.skinTextBox_OrderID.SkinTxt.Text;
                string costumeID = string.IsNullOrEmpty(this.costumeTextBox1.SkinTxt.Text) ? null : this.costumeTextBox1.SkinTxt.Text;


                pagePara = new AllocateOrderPagePara()
                {
                    CostumeID          = costumeID,
                    AllocateOrderID    = orderID,
                    AllocateOrderState = (AllocateOrderState)this.skinComboBox_State.SelectedValue,
                    IsOpenDate         = true,
                    SourceShopID       = CommonGlobalCache.CurrentShopID,
                    DestShopID         = ValidateUtil.CheckEmptyValue(this.skinComboBox_DestShop.SelectedValue),
                    StartDate          = new CJBasic.Date(this.dateTimePicker_Start.Value),
                    EndDate            = new CJBasic.Date(this.dateTimePicker_End.Value),
                    PageIndex          = 0,
                    PageSize           = this.dataGridViewPagingSumCtrl.PageSize
                };
                Search();
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
        private void BaseButton_Search_Click(object sender, EventArgs e)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                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;

                this.pagePara = new OutboundOrderPagePara()
                {
                    OrderID    = orderID,
                    CostumeID  = costumeID,
                    IsOpenDate = true,
                    StartDate  = new CJBasic.Date(this.dateTimePicker_Start.Value),
                    EndDate    = new CJBasic.Date(this.dateTimePicker_End.Value),
                    PageIndex  = 0,
                    PageSize   = this.dataGridViewPagingSumCtrl.PageSize,
                    ShopID     = IsPos ? CommonGlobalCache.CurrentShopID : null
                };
                OutboundOrderPage listPage = CommonGlobalCache.ServerProxy.GetOutboundOrderPage(this.pagePara);
                dataGridViewPagingSumCtrl.OrderPara = pagePara;
                this.dataGridViewPagingSumCtrl.Initialize(listPage);
                this.BindingOutboundOrderSource(listPage);
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #7
0
        private void baseButtonEnd_Click(object sender, EventArgs e)
        {
            try
            {
                if (GlobalMessageBox.Show("期初库存只能录入一次,确定录入完毕?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                InteractResult result = GlobalCache.ServerProxy.HideCreateStore();

                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    TabPageClose(this.CurrentTabPage, this.SourceCtrlType);
                    GlobalUtil.SaveParameters(ParameterConfigKey.IsHideCreateStore, "1");
                    End?.Invoke(this);
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ex) { GlobalUtil.ShowError(ex); }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
        private void BaseButton_Search_Click(object sender, EventArgs e)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                GetGuideDayAchievementsPara pagePara = new GetGuideDayAchievementsPara()
                {
                    ReportDate = curDayReport.ReportDate,
                    ShopID     = curDayReport.ShopID
                };
                List <GuideDayAchievement> listPage = CommonGlobalCache.ServerProxy.GetGuideDayAchievements(pagePara);
                //如果是今天的那么返回实时的如果不是调用原数据接口
                foreach (GuideDayAchievement item in listPage)
                {
                    item.GuideName = CommonGlobalCache.GetUserName(item.GuideID);
                    item.ShopName  = CommonGlobalCache.GetShopName(item.ShopID);
                }

                this.dataGridView1.DataSource  = null;
                SalesCountSum.DataPropertyName = "SalesCount";
                quantityOfSaleSumDataGridViewTextBoxColumn.DataPropertyName = "QuantityOfSale";
                moneyOfSaleSumDataGridViewTextBoxColumn.DataPropertyName    = "MoneyOfSale";
                this.dataGridView1.DataSource = listPage;
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
        private void SetGiftTicket(SkinComboBox skinComboBox_giftTicket)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                List <GiftTicketTemplate> templates = CommonGlobalCache.ServerProxy.GetGiftTicketTemplates();

                skinComboBox_giftTicket.DataSource    = null;
                skinComboBox_giftTicket.DisplayMember = "DenominationAndTickDesc";
                skinComboBox_giftTicket.ValueMember   = "AutoID";
                skinComboBox_giftTicket.DataSource    = templates;
            }
            catch (Exception ex)
            {
                ShowError(ex);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #10
0
        private void Search()
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                dataGridViewPagingSumCtrl.OrderPara = pagePara;
                MemberListPage listPage = CommonGlobalCache.ServerProxy.GetMemberListPage(this.pagePara);

                this.dataGridViewPagingSumCtrl.Initialize(listPage);
                this.BindingMemberDateSource(listPage);
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
        private void Form_Confirm(MonthTask obj)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                curMonthTask = obj;
                UpdateMonthTaskResult result = CommonGlobalCache.ServerProxy.UpdateMonthTask(curMonthTask);
                switch (result)
                {
                case UpdateMonthTaskResult.Success:
                    break;

                case UpdateMonthTaskResult.IsLessCurrentMonth:
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #12
0
        private void BaseButton_OK_Click(object sender, EventArgs e)
        {
            // RechargeResult result = RechargeResult.Error;
            try
            {
                /*  if (this.guideComboBox1.SelectedIndex == 0)
                 * {
                 *    GlobalMessageBox.Show("操作人不能为空");
                 *    return;
                 * }*/
                /*  if (this.member == null)
                 * {
                 *    GlobalMessageBox.Show("充值会员不能为空!");
                 *    return;
                 * }*/
                //if (this.member.CardType != 1)
                //{
                //    GlobalMessageBox.Show("该会员不是充值卡会员!");
                //    return;
                //}
                //  int rechargeMoney = int.Parse(this.skinTextBox_RechargeMoney.SkinTxt.Text);
                int     moneyCash     = Decimal.ToInt32(this.skinTextBox_MoneyCash.Value);
                int     moneyBankCard = Decimal.ToInt32(this.skinTextBox_MoneyBankCard.Value);
                int     moneyAlipay   = Decimal.ToInt32(this.skinTextBox_MoneyAlipay.Value);
                int     moneyWeiXin   = Decimal.ToInt32(this.skinTextBox_MoneyWeiXin.Value);
                int     rechargeMoney = moneyCash + moneyBankCard + moneyAlipay + moneyWeiXin;
                decimal donateM       = Decimal.ToInt32(numericTextBox1.Value);
                string  remarks       = this.skinTextBox_Remark.Text;
                if (rechargeMoney <= 0)
                {
                    GlobalMessageBox.Show("充值金额应为正整数,充值失败");
                    return;
                }

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

                int donateMoney = 0; //= int.Parse(this.skinLabel_GiveMoney.Text);
                                     //  decimal balanceNew = this.member.Balance + donateMoney + rechargeMoney;
                InteractResult result = CommonGlobalCache.ServerProxy.UpdateRechargeRecord(new UpdateRechargeRecordPara()
                {
                    ID            = curRechargeRecord.ID,
                    DonateMoney   = donateM,
                    MoneyAlipay   = moneyAlipay,
                    MoneyBankCard = moneyBankCard,
                    MoneyCash     = moneyCash,
                    MoneyWeiXin   = moneyWeiXin,
                    Remarks       = remarks,
                });


                UnLockPage();
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    //   RechargeDialogForm form = new RechargeDialogForm(member, rechargeMoney, donateMoney, balanceNew);

                    /*  if (form.ShowDialog() == DialogResult.OK)
                     * {
                     *
                     * }*/
                    GlobalMessageBox.Show("修改成功!");
                    this.DialogResult = DialogResult.OK;
                    //  this.ParentForm.Refresh();
                    // this.Close();
                    //   this.member = CommonGlobalCache.ServerProxy.GetOneMember(this.member.PhoneNumber);

                    /* this.SetMemberLabel();
                     * this.CleanRechargeTextBox();*/
                    //20180616充值完成自动关闭!
                    //  if (isClose) {
                    //只给POS端收银充值用
                    /*   TabPageClose(this.CurrentTabPage, this);*/
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ee)
            {
                WriteLog(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #13
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     /* if (e.RowIndex < 0 || e.ColumnIndex < 0)
      * {
      *   return;
      * }
      * try
      * {
      *   //if (CommonGlobalUtil.EngineUnconnectioned(this))
      *   //{
      *   //    return;
      *   //}
      *   DataGridView view = (DataGridView)sender;
      *   if (e.ColumnIndex == quantityOfSaleDataGridViewTextBoxColumn.Index)
      *   {
      *       List<SalesAnalysis> curDayReportListSource = DataGridViewUtil.BindingListToList<SalesAnalysis>(dataGridView1.DataSource);
      *       //  List<RetailAnalysisInfo> curDayReportListSource = (List<RetailAnalysisInfo>)view.DataSource;
      *       // curDayReportListSource.
      *       SalesAnalysis item = curDayReportListSource[e.RowIndex];
      *       //  DetailClick(item, pagePara.BrandID, pagePara.SupplierID, pagePara.ClassID);
      *       CostumeRetailAnalysisDetailForm form = new CostumeRetailAnalysisDetailForm();
      *       form.getData();
      *       //form.ShowDialog(item, dateTimePicker_Start, dateTimePicker_End, pagePara, this);
      *       // DetailClick(item);
      *   }
      * }
      * catch (Exception ee)
      * {
      *
      *   ShowError(ee);
      * }
      * finally
      * {
      *   UnLockPage();
      * }
      */
     if (e.RowIndex < 0 || e.ColumnIndex < 0)
     {
         return;
     }
     try
     {
         if (e.ColumnIndex == quantityOfSaleDataGridViewTextBoxColumn.Index)
         {
             try
             {
                 if (CommonGlobalUtil.EngineUnconnectioned(this))
                 {
                     return;
                 }
                 //CostumeRetailAnalysisDetailForm form = new CostumeRetailAnalysisDetailForm();
                 //form.getData();
                 List <SalesAnalysis> curDayReportListSource = DataGridViewUtil.BindingListToList <SalesAnalysis>(dataGridView1.DataSource);
                 SalesAnalysis        item = curDayReportListSource[e.RowIndex];
                 DetailClick(item);
             }
             catch (Exception ee)
             {
                 ShowError(ee);
             }
             finally
             {
                 UnLockPage();
             }
         }
     }
     catch (Exception ee)
     {
         ShowError(ee);
     }
     finally
     {
         UnLockPage();
     }
 }
Exemple #14
0
        private void BaseButton_Search_Click(object sender, EventArgs e)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                int    brand   = Convert.ToInt32(ValidateUtil.CheckEmptyValue(this.skinComboBox_Brand.SelectedValue));
                string typeStr = ValidateUtil.CheckEmptyValue(skinComboBoxGroup.SelectedValue);
                pagePara = new GetSalesAnalysisPara()
                {
                    ShopID     = ValidateUtil.CheckEmptyValue(this.skinComboBoxShopID.SelectedValue),
                    CostumeID  = this.skinTextBoxID.SkinTxt.Text,
                    StartDate  = new CJBasic.Date(this.dateTimePicker_Start.Value),
                    EndDate    = new CJBasic.Date(this.dateTimePicker_End.Value),
                    BrandID    = brand,
                    SupplierID = ValidateUtil.CheckEmptyValue(skinComboBoxSupplier.SelectedValue),
                    Type       = typeStr,
                    ClassID    = (int)skinComboBoxBigClass.SelectedValue.ClassID,

                    //GroupType = (GroupType)skinComboBoxGroup.SelectedValue,
                    // IsGetGeneralStore = CommonGlobalCache.IsGeneralStoreRetail=="1"
                };

                //if (pagePara.GroupType == GroupType.Shop)
                //{
                //    ColumnDetail.Visible = true;
                //}
                //else
                //{
                //    ColumnDetail.Visible = false;
                //}
                DateTime STime = DateTime.Now;
                InteractResult <SalesAnalysisInfo> list = CommonGlobalCache.ServerProxy.GetSalesAnalysis(this.pagePara);

                DateTime ETime = DateTime.Now;
                TimeSpan spanA = (TimeSpan)(ETime - STime);

                WriteLog("销售分析零售数据加载开始时间:" + STime + " 结束时间:" + ETime + " 总耗时数:" + spanA.TotalSeconds + "秒");
                //GlobalMessageBox.Show("数据加载完成!");


                /*   if (String.IsNullOrEmpty(pagePara.CostumeID))
                 * {
                 *     groupTypeNameDataGridViewTextBoxColumn.HeaderText = "分组";
                 * }
                 * else
                 * {
                 *     if (pagePara.ShopID == null)
                 *     {
                 *         groupTypeNameDataGridViewTextBoxColumn.HeaderText = "店鋪";
                 *     }
                 *     else
                 *     {
                 *         groupTypeNameDataGridViewTextBoxColumn.HeaderText = "款号";
                 *     }
                 * }*/
                DateTime startTime = DateTime.Now;
                String[] strs      = typeStr.Split('+');
                if (strs.Length == 1)
                {//款号
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = false;
                    TypeValue3.Visible    = false;
                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                    listColumn.Add(TypeValue4);
                    listColumn.Add(TypeValue5);
                    listColumn.Add(TypeValue6);
                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 2)
                {//供应商+款号、品牌 + 款号、日期 + 款号
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = false;
                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                    listColumn.Add(TypeValue4);
                    listColumn.Add(TypeValue5);
                    listColumn.Add(TypeValue6);
                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 3)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                    listColumn.Add(TypeValue4);
                    listColumn.Add(TypeValue5);
                    listColumn.Add(TypeValue6);
                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 4)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    TypeValue4.Visible    = true;
                    TypeValue4.HeaderText = strs[3];
                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                    listColumn.Add(TypeValue5);
                    listColumn.Add(TypeValue6);
                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 5)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    TypeValue4.Visible    = true;
                    TypeValue4.HeaderText = strs[3];
                    TypeValue5.Visible    = true;
                    TypeValue5.HeaderText = strs[4];

                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();

                    listColumn.Add(TypeValue6);
                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 6)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    TypeValue4.Visible    = true;
                    TypeValue4.HeaderText = strs[3];
                    TypeValue5.Visible    = true;
                    TypeValue5.HeaderText = strs[4];
                    TypeValue6.Visible    = true;
                    TypeValue6.HeaderText = strs[5];

                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();

                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 7)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    TypeValue4.Visible    = true;
                    TypeValue4.HeaderText = strs[3];
                    TypeValue5.Visible    = true;
                    TypeValue5.HeaderText = strs[4];
                    TypeValue6.Visible    = true;
                    TypeValue6.HeaderText = strs[5];
                    TypeValue7.Visible    = true;
                    TypeValue7.HeaderText = strs[6];

                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 8)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    TypeValue4.Visible    = true;
                    TypeValue4.HeaderText = strs[3];
                    TypeValue5.Visible    = true;
                    TypeValue5.HeaderText = strs[4];
                    TypeValue6.Visible    = true;
                    TypeValue6.HeaderText = strs[5];
                    TypeValue7.Visible    = true;
                    TypeValue7.HeaderText = strs[6];
                    TypeValue8.Visible    = true;
                    TypeValue8.HeaderText = strs[7];
                }



                if (!String.IsNullOrEmpty(pagePara.CostumeID))
                {
                    if (strs.Length == 1)
                    {//款号
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = false;
                        TypeValue3.Visible    = false;
                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue4);
                        listColumn.Add(TypeValue5);
                        listColumn.Add(TypeValue6);
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }
                    else
                    if (strs.Length == 2)
                    {//供应商+款号、品牌 + 款号、日期 + 款号
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = false;
                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue4);
                        listColumn.Add(TypeValue5);
                        listColumn.Add(TypeValue6);
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }
                    else
                    if (strs.Length == 3)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];
                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue4);
                        listColumn.Add(TypeValue5);
                        listColumn.Add(TypeValue6);
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }
                    else
                    if (strs.Length == 4)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];
                        TypeValue4.Visible    = true;
                        TypeValue4.HeaderText = strs[3];
                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue5);
                        listColumn.Add(TypeValue6);
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }
                    else
                    if (strs.Length == 5)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];
                        TypeValue4.Visible    = true;
                        TypeValue4.HeaderText = strs[3];
                        TypeValue5.Visible    = true;
                        TypeValue5.HeaderText = strs[4];
                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue6);
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }
                    else
                    if (strs.Length == 6)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];
                        TypeValue4.Visible    = true;
                        TypeValue4.HeaderText = strs[3];
                        TypeValue5.Visible    = true;
                        TypeValue5.HeaderText = strs[4];
                        TypeValue6.Visible    = true;
                        TypeValue6.HeaderText = strs[5];
                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }
                    else
                    if (strs.Length == 7)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];
                        TypeValue4.Visible    = true;
                        TypeValue4.HeaderText = strs[3];
                        TypeValue5.Visible    = true;
                        TypeValue5.HeaderText = strs[4];
                        TypeValue6.Visible    = true;
                        TypeValue6.HeaderText = strs[5];
                        TypeValue7.Visible    = true;
                        TypeValue7.HeaderText = strs[6];
                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }
                    else
                    if (strs.Length == 8)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];
                        TypeValue4.Visible    = true;
                        TypeValue4.HeaderText = strs[3];
                        TypeValue5.Visible    = true;
                        TypeValue5.HeaderText = strs[4];
                        TypeValue6.Visible    = true;
                        TypeValue6.HeaderText = strs[5];
                        TypeValue7.Visible    = true;
                        TypeValue7.HeaderText = strs[6];
                        TypeValue8.Visible    = true;
                        TypeValue8.HeaderText = strs[7];
                    }
                }
                DateTime endTime = DateTime.Now;
                TimeSpan span    = (TimeSpan)(endTime - startTime);
                WriteLog("销售分析零售数据设置加载开始时间:" + startTime + " 结束时间:" + endTime + " 总耗时数:" + span.TotalSeconds + "秒");
                this.BindingDataSource(list.Data);
            }
            catch (Exception ex)
            {
                ShowError(ex);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #15
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                string MemId = this.skinTextBox_ID.Text;
                if (string.IsNullOrEmpty(MemId))
                {
                    GlobalMessageBox.Show("卡号不能为空!");
                    return;
                }
                //^[0-9A-Za-z_]+$
                string matchID    = "^[0-9A-Za-z]+$";
                bool   isMemberID = Regex.IsMatch(MemId, matchID);
                if (!isMemberID)
                {
                    GlobalMessageBox.Show("卡号格式不正确,卡号只能含数字或英文字母!");
                    return;
                }

                string phoneNumber = this.txttel.Text;
                if (string.IsNullOrEmpty(phoneNumber))
                {
                    GlobalMessageBox.Show("手机号不能为空!");
                    return;
                }

                string match         = "^((1[3,5,8][0-9])|(14[5,7])|(17[0,6,7,8])|(19[7]))\\d{8}$";
                bool   isPhoneNumber = Regex.IsMatch(phoneNumber, match);
                if (!isPhoneNumber)
                {
                    GlobalMessageBox.Show("手机号码格式不正确!");
                    return;
                }
                string name = this.skinTextBox_Name.Text;
                if (string.IsNullOrEmpty(name))
                {
                    GlobalMessageBox.Show("姓名不能为空!");
                    return;
                }
                //if (!isOnline && (String.IsNullOrEmpty(this.guideID) || "-1".Equals(this.guideID)))
                //{
                //    GlobalMessageBox.Show("操作人不能为空!");
                //    return;
                //}
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                //string cintegration = this.skinTextBox_CurrentIntegration.Text;
                if (this._member != null)
                {
                    UpdateMemberResult result = this.UpdateMember();
                    if (result == UpdateMemberResult.Error)
                    {
                        GlobalMessageBox.Show("内部错误!");
                    }
                    else if (result == UpdateMemberResult.IsNotExist)
                    {
                        GlobalMessageBox.Show("会员卡号不存在!");
                    }
                    else if (result == UpdateMemberResult.Success)
                    {
                        TreeModel treeN = new TreeModel();
                        treeN.ID   = _member.PhoneNumber;
                        treeN.Name = _member.Name;
                        CommonGlobalCache.UpdateDistributor(treeN);
                        GlobalMessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK);
                        this.TabPageClose(this.CurrentTabPage, this.SourceCtrlType);
                    }
                }
                else
                {
                    InteractResult result = this.AddMember();
                    if (result.ExeResult == ExeResult.Success)
                    {
                        //TreeModel treeN = new TreeModel();
                        //treeN.ID = member.PhoneNumber;
                        //treeN.ParentID = member.IntroducerName;
                        //treeN.Name = member.Name;
                        //CommonGlobalCache.InsertDistributor(treeN);
                        CommonGlobalCache.DistributorList.Clear();
                        GlobalMessageBox.Show("开卡成功!", "提示", MessageBoxButtons.OK);
                        // member
                        this.TabPageClose(this.CurrentTabPage, this.SourceCtrlType);
                    }
                    else
                    {
                        GlobalMessageBox.Show(result.Msg);
                    }
                    //if (result == RegisterMemberResult.Error)
                    //{
                    //    GlobalMessageBox.Show("内部错误!");
                    //}
                    //else if (result == RegisterMemberResult.Exist)
                    //{
                    //    GlobalMessageBox.Show("会员卡号已存在!");
                    //}
                    //else if (result == RegisterMemberResult.Success)
                    //{
                    //    GlobalMessageBox.Show("开卡成功!", "提示", MessageBoxButtons.OK);
                    //    this.TabPageClose(this.CurrentTabPage, this);

                    //}
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
        private void BaseButton_OK_Click(object sender, EventArgs e)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                if (dataGridView1.Rows.Count > 0)
                {
                    int                index            = this.dataGridView1.SelectedCells[0].RowIndex;
                    Costume            curCostume       = currentSource[index];
                    List <CostumeItem> selectResultItem = CommonGlobalCache.ServerProxy.GetPfCustomerStores(CustomerID, curCostume.ID, true);

                    /*   List<CostumeItem> selectResultItem = CommonGlobalCache.ServerProxy.GetCostumeStoreList(new CostumeStoreListPara()
                     * {
                     *     CostumeID = curCostume.ID,
                     *     ShopID = this.ShopID,
                     *     IsOnlyShowValid = filterValid,
                     *     IsAccurateQuery = true,
                     *
                     * });
                     */
                    if (curSuplierId != null && curCostume != null)
                    {
                        selectResultItem = selectResultItem.FindAll(i => i.Costume.SupplierID == curSuplierId);
                    }
                    if (selectResultItem.Count > 0)
                    {
                        this.ConfirmSelectCell(selectResultItem[0]);
                    }
                    else
                    {
                        CostumeItem         pfCostumeItem = new CostumeItem();
                        List <CostumeStore> cStore        = new List <CostumeStore>();
                        pfCostumeItem.Costume = curCostume;

                        String[] colors = CommonGlobalUtil.GetStringSplit(pfCostumeItem.Costume.Colors, ',');
                        //创建虚拟库存信息
                        foreach (var color in colors)
                        {
                            //color not existed,then add one
                            cStore.Add(SetupStores(pfCostumeItem, color));
                        }

                        pfCostumeItem.CostumeStoreList = cStore;
                        this.ConfirmSelectCell(pfCostumeItem);
                        //curCostume.ColorList
                        //pfCostumeItem.CostumeStoreList = cStore;
                        //  ShowMessage("该店铺不存在该商品!");
                    }
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }

            finally
            {
                UnLockPage();
            }
        }
Exemple #17
0
        private void Search()
        {
            try
            {
                string PfCustomerID = curSelectStr.Trim();
                if (string.IsNullOrEmpty(PfCustomerID))
                {
                    this.ItemSelected?.Invoke(null);
                    return;
                }

                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                List <PfCustomer> pfCustomerList = PfCustomerCache.PfCustomerList;
                if (pfCustomerList != null && CustomerTypeValue != -1)
                {
                    pfCustomerList = pfCustomerList.FindAll(t => t.CustomerType == CustomerTypeValue);
                }

                if (this.DropDownStyle == ComboBoxStyle.DropDown || this.DropDownStyle == ComboBoxStyle.DropDownList)
                {
                    resultList = pfCustomerList.FindAll(t => t.ID.Contains(PfCustomerID) || t.Name.Contains(PfCustomerID));
                }
                else
                {
                    resultList = pfCustomerList.FindAll(t => t.ID.Contains(PfCustomerID));
                }


                //CommonGlobalCache.ServerProxy.GetPfCustomersLike4IDOrName(PfCustomerID);



                if (resultList == null || resultList.Count == 0)
                {
                    if (this.ItemSelected != null)
                    {
                        this.ItemSelected(null);
                    }
                    //  this.SkinTxt.Text = "";
                    return;
                }
                if (resultList.Count == 1)
                {
                    if (this.DropDownStyle == ComboBoxStyle.DropDown || this.DropDownStyle == ComboBoxStyle.DropDownList)
                    {
                        this.SelectedValue = resultList[0].ID;
                    }
                    else
                    {
                        this.Text = resultList[0].ID;
                    }
                    this.ItemSelected?.Invoke(resultList[0]);
                }
                else
                {
                    PfCustomerSelectForm PfCustomerForm = new PfCustomerSelectForm(PfCustomerID, resultList);
                    PfCustomerForm.ItemSelected += PfCustomerForm_PfCustomerSelected;
                    PfCustomerForm.ShowDialog();
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #18
0
        public void Search()
        {
            try
            {
                isBarCode = false;

                string costumeID = this.SkinTxt.Text.Trim();
                if (string.IsNullOrEmpty(costumeID))
                {
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(null, true);
                    }
                    return;
                }

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

                //条形码,先根据条形码获取款号
                //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper()));

                ////,条形码为一条,找到这个款号
                //if (barCodes != null && barCodes.Count == 1)
                //{
                //    costumeID = barCodes[0].CostumeID;
                //    this.SkinTxt.Text = barCodes[0].BarCodeValue;
                //    isBarCode = true;
                //}
                //String barCode=

                /*   if (costumeID.Length == 15)
                 * {
                 *     BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID);
                 *     if (costume != null)
                 *     {
                 *         costumeID = costume.CostumeID;
                 *         SkinTxt.Text = costume.BarCode;
                 *         isBarCode = true;
                 *     }
                 * }*/

                List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => t.ID.ToUpper().Equals(costumeID.ToUpper()));
                if (filterValid)
                {
                    resultList = resultList.FindAll(t => t.IsValid);
                }
                if (resultList == null || resultList.Count == 0)
                {
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(null, true);
                    }
                    return;
                }
                if (resultList.Count == 1)
                {
                    resultList[0].BrandName    = CommonGlobalCache.GetBrandName(resultList[0].BrandID);
                    resultList[0].SupplierName = CommonGlobalCache.GetSupplierName(resultList[0].SupplierID);
                    if (!isBarCode)
                    {
                        this.SkinTxt.Text = resultList[0].ID;
                    }
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(resultList[0], true);
                    }
                }
                else
                {
                    /*  CostumeForm costumeForm = new CostumeForm(resultList, costumeID, filterValid);
                     * //   costumeForm.CostumeSelected += CostumeForm_CostumeSelected;
                     * if (costumeForm.ShowDialog() == DialogResult.OK)
                     * {
                     *    this.SkinTxt.Text = costumeForm.Result.ID;
                     *    CostumeSelected?.Invoke(costumeForm.Result, true);
                     * }*/
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #19
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            List <CheckStoreOrder> list            = (List <CheckStoreOrder>) this.dataGridView1.DataSource;
            CheckStoreOrder        checkStoreOrder = list[e.RowIndex];

            if (e.ColumnIndex == iDDataGridViewTextBoxColumn.Index)
            {
                if (currentCheckStoreOrder != checkStoreOrder)
                {
                    currentCheckStoreOrder = checkStoreOrder;
                    SelectionChanged(checkStoreOrder);
                }

                if (checkStoreOrder == null || String.IsNullOrEmpty(checkStoreOrder.ID))
                {
                    return;
                }
            }
            else if (e.ColumnIndex == ColumnEdit.Index)
            {
                this.UpdateCheckStoreOrderClick?.Invoke(checkStoreOrder, this);
            }
            else if (e.ColumnIndex == ColumnDelete.Index)
            {
                try
                {
                    //删除
                    if (GlobalMessageBox.Show("确定删除吗?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        if (CommonGlobalUtil.EngineUnconnectioned(this))
                        {
                            return;
                        }
                        DeleteCheckStoreResult result = CommonGlobalCache.ServerProxy.DeleteCheckStore(checkStoreOrder.ID);
                        switch (result)
                        {
                        case DeleteCheckStoreResult.Success:
                            GlobalMessageBox.Show("删除成功!");
                            //含统计信息,从刷界面
                            dataGridViewPagingSumCtrl_CurrentPageIndexChanged(this.pagePara.PageIndex);
                            break;

                        case DeleteCheckStoreResult.StateIsPendingReviewOrApproved:
                            GlobalMessageBox.Show("状态是待审核或已审核,不能删除");
                            break;

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

                        default:
                            break;
                        }
                    }
                }
                catch (Exception ee)
                {
                    ShowError(ee);
                }
                finally
                {
                    UnLockPage();
                }
            }
            else if (ColumnCancel.Index == e.ColumnIndex)
            {
                this.Cancel(checkStoreOrder);
            }
            else if (ColumnRedo.Index == e.ColumnIndex)
            {
                this.Redo(checkStoreOrder);
            }
            else if (e.ColumnIndex == ColumnPrint.Index)
            {
                //打印
                if (currentCheckStoreOrder != checkStoreOrder)
                {
                    currentCheckStoreOrder = checkStoreOrder;
                    SelectionChanged(checkStoreOrder);
                }

                if (checkStoreOrder == null || String.IsNullOrEmpty(checkStoreOrder.ID))
                {
                    return;
                }
                checkStoreDetailCtrl1?.Print();
            }
            else if (e.ColumnIndex == Column1.Index)
            {
                //导出
                path = CJBasic.Helpers.FileHelper.GetPathToSave("保存文件", "盘点单" + checkStoreOrder.ID + new Date(DateTime.Now).ToDateInteger() + ".xls", Environment.GetFolderPath(Environment.SpecialFolder.Personal));
                if (String.IsNullOrEmpty(path))
                {
                    return;
                }

                // this.CheckStoreDetailExcept?.Invoke(checkStoreOrder, this, path);
                checkStoreDetailCtrl1?.DoExport(path, checkStoreOrder);
            }
        }
Exemple #20
0
        //点击入库按钮
        private void BaseButton_Inbound_Click(object sender, EventArgs e)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                /*   if (this.guideComboBox1.SelectedIndex == 0 && IsPos)
                 * {
                 *     GlobalMessageBox.Show("操作人不能为空");
                 *     return;
                 * }
                 */
                /*  foreach (BoundDetail detail in this.curOutbound.OutboundDetails)
                 * {
                 *  // detail.IsConfirmed = true;
                 *  if (!detail.IsConfirmed)
                 *   {
                 *       DialogResult dialogResult= GlobalMessageBox.Show("您有商品未确认完全,是否确认收货?", "提示", MessageBoxButtons.OKCancel);
                 *       if (dialogResult != DialogResult.OK)
                 *       {
                 *           return;
                 *       }
                 *       break;
                 *   }
                 *
                 * }*/
                InboundPara inboundPara = this.BuildInboundPara();
                if (inboundPara == null || inboundPara.InboundOrder.TotalCount == 0)
                {
                    GlobalMessageBox.Show("入库单为空,不能入库!");
                    return;
                }

                InboundResult result = CommonGlobalCache.ServerProxy.Inbound(inboundPara);

                if (result == InboundResult.Error)
                {
                    GlobalMessageBox.Show("内部错误!");
                    return;
                }
                else if (result == InboundResult.StateIsNotDelivery)
                {
                    GlobalMessageBox.Show("款号已存在!");
                    return;
                }
                GlobalMessageBox.Show("收货成功!");

                // pos端确认后结束,在调拨入库时候
                this.BaseButton_Save.Visible = false;
                this.guideComboBox1.Visible  = false;
                this.skinLabel2.Visible      = false;

                //pos使用
                this.SaveSuccess();
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #21
0
        private void BaseButton_Search_Click(object sender, EventArgs e)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                string             orderID      = string.IsNullOrEmpty(this.skinTextBox_OrderID.SkinTxt.Text) ? null : this.skinTextBox_OrderID.SkinTxt.Text;
                string             costumeID    = string.IsNullOrEmpty(this.costumeTextBox1.SkinTxt.Text) ? null : this.costumeTextBox1.SkinTxt.Text;
                string             shopid       = ValidateUtil.CheckEmptyValue(this.shopComboBox1.SelectedValue);
                AllocateOrderState state        = (AllocateOrderState)this.skinComboBox_State.SelectedValue;
                AllocateOrderType  type         = (AllocateOrderType)this.skinComboType.SelectedValue;
                string             descShopId   = ValidateUtil.CheckEmptyValue(this.ShopCmbGet.SelectedValue);
                string             SourceShopId = ValidateUtil.CheckEmptyValue(this.shopCmbSend.SelectedValue);
                // AllocateOrderState boundState=(AllocateOrderState)skinComboBoxBoundState.SelectedValue;

                /* if (boundState != AllocateOrderState.All)
                 * {
                 *   state = boundState;
                 * }*/
                /*   pagePara = new AllocateOrderPagePara()
                 * {
                 *     CostumeID = costumeID,
                 *     AllocateOrderID = orderID,
                 *     AllocateOrderState = state,
                 *     IsOpenDate = this.isOpenDate,
                 *   //  SourceShopID = ValidateUtil.CheckEmptyValue(this.skinComboBox_SourceShop.SelectedValue),
                 *  //   DestShopID = ValidateUtil.CheckEmptyValue(this.skinComboBox_DestShop.SelectedValue),
                 *
                 *     StartDate = new CJBasic.Date(this.dateTimePicker_Start.Value),
                 *     EndDate = new CJBasic.Date(this.dateTimePicker_End.Value),
                 *     PageIndex = 0,
                 *     PageSize = this.dataGridViewPagingSumCtrl.PageSize
                 * };*/

                /* if (pagePara.DestShopID == pagePara.SourceShopID)
                 * {
                 *   ShowError("发货方与收货方不能相同!");
                 *   return;
                 * }*/
                //  AllocateOrderPage listPage = null;
                //   listPage = CommonGlobalCache.ServerProxy.GetAllocateOrderPage(this.pagePara);
                pagePara = new GetAllocateOrdersPara()
                {
                    AllocateOrderID    = orderID,
                    AllocateOrderState = state,
                    CostumeID          = costumeID,
                    EndDate            = new CJBasic.Date(this.dateTimePicker_End.Value),
                    StartDate          = new CJBasic.Date(this.dateTimePicker_Start.Value),
                    ShopID             = shopid,
                    Type         = type,
                    PageIndex    = 0,
                    PageSize     = this.dataGridViewPagingSumCtrl.PageSize,
                    ReceiptState = (ReceiptState)skinCmbReceiptState.SelectedValue,
                    LockShop     = isCheckOnlyCurShop,
                    DestShopID   = descShopId,
                    SourceShopID = SourceShopId,
                    Remarks      = ValidateUtil.CheckEmptyValue(this.txtRemark.SkinTxt.Text),
                };
                InteractResult <AllocateOrderPage> allOrderPage = CommonGlobalCache.ServerProxy.GetAllocateOrders(pagePara);
                dataGridViewPagingSumCtrl.OrderPara = pagePara;
                this.dataGridViewPagingSumCtrl.Initialize(allOrderPage.Data);
                this.BindingAllocateOrderSource(allOrderPage.Data);
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
        private void BaseButtonAdd_Click(object sender, EventArgs e)
        {
            try
            {
                if (GlobalMessageBox.Show("是否确认操作?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                string id = IDHelper.GetID(OrderPrefix.ConfusedStoreAdjustRecord, shop.AutoCode);

                ConfusedStoreAdjustRecord para = new ConfusedStoreAdjustRecord()
                {
                    OrderID        = id,
                    CostumeID      = currentSelectedItem?.Costume?.ID,
                    ColorName1     = ValidateUtil.CheckEmptyValue(skinComboBox_Color.SelectedValue),
                    ColorName2     = ValidateUtil.CheckEmptyValue(skinComboBox_Color1.SelectedValue),
                    SizeName1      = CostumeStoreHelper.GetCostumeSize(ValidateUtil.CheckEmptyValue(skinComboBox_Size.SelectedValue), CommonGlobalCache.DefaultSizeGroup),
                    SizeName2      = CostumeStoreHelper.GetCostumeSize(ValidateUtil.CheckEmptyValue(skinComboBox_Size1.SelectedValue), CommonGlobalCache.DefaultSizeGroup),
                    Remarks        = skinTextBox_Remark.Text,
                    CountPre1      = skinLabelStore,
                    CountPre2      = skinLabelStore1,
                    CountNow1      = skinLabelStore - int.Parse(skinTextBox_MoneyCash.Text),
                    CountNow2      = skinLabelStore1 + int.Parse(skinTextBox_MoneyCash1.Text),
                    ShopID         = ValidateUtil.CheckEmptyValue(skinComboBoxShopID.SelectedValue),
                    OperatorUserID = userID,
                };

                if (String.IsNullOrEmpty(para.CostumeID))
                {
                    GlobalMessageBox.Show("请选择款号!");
                    return;
                }
                if (para.ColorName1 == para.ColorName2 && para.SizeName1 == para.SizeName2)
                {
                    GlobalMessageBox.Show("请选择不同颜色或者尺码!");
                    return;
                }
                if (para.CountPre1 == 0)
                {
                    GlobalMessageBox.Show("库存为0,不能向下调整!");
                    return;
                }
                InteractResult result = CommonGlobalCache.ServerProxy.AddConfusedStoreAdjustRecord(para);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    GlobalMessageBox.Show("调整成功!");
                    //重新获取该款库存信息
                    this.skinTextBox_costumeID.Reload();
                    //this.TabPageClose(CurrentTabPage, SourceCtrlType);
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                ShowError(ex);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #23
0
        private void dataGridView1_SelectionChanged(object sender, EventArgs e)
        {
            if (dataGridView1.CurrentRow != null && dataGridView1.Rows.Count > 0)
            {
                try
                {
                    if (CommonGlobalUtil.EngineUnconnectioned(this))
                    {
                        return;
                    }

                    List <CostumeStore> dt = DataGridViewUtil.BindingListToList <CostumeStore>(dataGridView1.DataSource);
                    if (dt.Count > 0 && this.dataGridView1.CurrentRow.DataBoundItem != null)
                    {
                        CostumeStore item = (CostumeStore)dataGridView1.CurrentRow.DataBoundItem;
                        if (curCostume != item && skinCheckBoxShowImage.Checked)
                        {
                            if (imageCtrl != null)
                            {
                                imageCtrl?.Close();
                                imageCtrl = null;
                            }
                            skinCheckBoxShowImage.CheckedChanged -= skinCheckBoxShowImage_CheckedChanged;
                            skinCheckBoxShowImage.Checked         = true;
                            skinCheckBoxShowImage.CheckedChanged += skinCheckBoxShowImage_CheckedChanged;

                            imageCtrl              = new SingleImageForm();
                            imageCtrl.FormClosing += ImageCtrl_FormClosing;
                            imageCtrl.Text         = "款号:" + item.CostumeID;
                            imageCtrl.OnLoadingState();
                            Costume Curitem = CommonGlobalCache.GetCostume(item.CostumeID);
                            // byte[] bytes = CommonGlobalCache.ServerProxy.GetCostumePhoto(item.CostumeID);
                            if (Curitem.EmThumbnail != null)
                            {
                                System.Net.WebRequest  webreq = System.Net.WebRequest.Create(Curitem.EmThumbnail);
                                System.Net.WebResponse webres = webreq.GetResponse();
                                using (System.IO.Stream stream = webres.GetResponseStream())
                                {
                                    imageCtrl.Image = Image.FromStream(stream);
                                }
                                // imageCtrl.Image = CCWin.SkinControl.ImageHelper.Convert(bytes);
                            }
                            else
                            {
                                imageCtrl.Image = null;
                            }
                            imageCtrl?.BringToFront();
                            imageCtrl?.Show();
                            curCostume = item;
                        }
                        //  dataGridView1.CurrentRow.Index = -1;
                    }
                }
                catch (Exception ex)
                {
                    // ShowError(ex);
                }
                finally
                {
                    UnLockPage();
                }
            }
        }
        private void BaseButton1_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.guideComboBox1.Visible && this.guideComboBox1.SelectedIndex == 0)
                {
                    GlobalMessageBox.Show("操作人不能为空");
                    return;
                }
                if (GlobalMessageBox.Show("是否确认操作?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                DifferenceOrderConfirmedResult result = CommonGlobalCache.ServerProxy.DifferenceOrderConfirmed(new DifferenceOrderConfirmedPara()
                {
                    DifferenceOrderID = this.curDifferenceOrder.ID,
                    ConfirmUserID     = IsPos ? ValidateUtil.CheckEmptyValue(this.guideComboBox1.SelectedValue) : CommonGlobalCache.CurrentUserID
                });
                switch (result)
                {
                case DifferenceOrderConfirmedResult.Success:
                    GlobalMessageBox.Show("确认成功!");
                    if (IsPos)
                    {
                        this.guideComboBox1.Visible  = false;
                        this.skinLabel_operator.Text = "操作人:" + ((Guide)this.guideComboBox1.SelectedItem).Name;
                    }
                    else
                    {
                        this.skinLabel_operator.Text = "操作人:" + CommonGlobalCache.GetUserName(CommonGlobalCache.CurrentUser.ID);
                    }
                    this.BaseButtonCancel.Visible  = false;
                    this.baseButtonConfirm.Visible = false;
                    WorkDesk_Refresh?.Invoke(false, null);
                    this.RefreshPageAction?.Invoke(this.CurrentTabPage, this.SourceCtrlType);
                    break;

                case DifferenceOrderConfirmedResult.SourceOrderIDIsError:
                    GlobalMessageBox.Show("不是盘点,补货申请或者调拨!");
                    break;

                case DifferenceOrderConfirmedResult.IsConfirmed:
                    GlobalMessageBox.Show("本单已被确认!");
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #25
0
        private void Cancel(RetailOrder allocateOrder)
        {
            try
            {
                if (!String.IsNullOrEmpty(allocateOrder.RefundOrderID))

                {
                    GlobalMessageBox.Show("销售单已退货,不能冲单!");
                    return;
                }
                String userId = string.Empty;
                if (IsPos)
                {
                    SelectGuideForm form = new SelectGuideForm();
                    if (form.ShowDialog(this.FindForm()) != DialogResult.OK)
                    {
                        return;
                    }
                    else
                    {
                        userId = form.Guide.ID;
                    }
                }
                else
                {
                    if (GlobalMessageBox.Show("是否确认操作?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                    {
                        return;
                    }
                    userId = CommonGlobalCache.CurrentUserID;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                CancelRetailOrderPara para = new CancelRetailOrderPara()
                {
                    CancelGuideID = userId,
                    RetailOrderID = allocateOrder.ID
                };

                InteractResult result = null;
                if (allocateOrder.IsRefundOrder)
                {
                    result = CommonGlobalCache.ServerProxy.CancelRefundOrder(para);
                }
                else
                {
                    result = CommonGlobalCache.ServerProxy.CancelRetailOrder(para);
                }
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    GlobalMessageBox.Show("冲单成功!");

                    break;

                //case ExeResult.IsNotToday:
                //    GlobalMessageBox.Show("不是今天的销售/退货单!");
                //    break;
                //case CancelRetailOrderResult.IsRefundOrder:
                //    GlobalMessageBox.Show("不是销售单!");
                //    break;
                case ExeResult.Error:
                    GlobalMessageBox.Show(result.Msg);
                    break;

                default:
                    break;
                }
                this.RefreshPage();
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
        private void BaseButtonConfirm_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.bean == null)
                {
                    GlobalMessageBox.Show(this, "找不到客户信息");
                    this.textBoxCustomer.Focus();
                    return;
                }

                if (this.textBoxAmount.Value == 0)
                {
                    GlobalMessageBox.Show(this, "请输入金额");
                    this.textBoxAmount.Focus();
                    return;
                }

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


                PfCustomerRechargeRecord pfCustomerRechargeRecord = new PfCustomerRechargeRecord()
                {
                    BalanceOld = this.bean.Balance,
                    BalanceNew = this.bean.Balance + decimal.ToInt32(textBoxAmount.Value),
                    ID         = IDHelper.GetID(OrderPrefix.PfCustomerRechargeRecord, CommonGlobalCache.CurrentShop.AutoCode),
                    //  BalanceOld =
                    Remarks       = richTextBoxRemark.Text,
                    PfCustomerID  = bean.ID,
                    CreateTime    = DateTime.Now,
                    RechargeMoney = decimal.ToInt32(textBoxAmount.Value)
                };

                InteractResult result = GlobalCache.ServerProxy.InsertPfCustomerRechargeRecord(pfCustomerRechargeRecord);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    GlobalMessageBox.Show(this.FindForm(), "添加成功!");
                    this.bean.Balance = pfCustomerRechargeRecord.BalanceNew;
                    //TabPageClose(this.CurrentTabPage, this.SourceCtrlType);
                    PfCustomerRechargeRecordSuccess?.Invoke(pfCustomerRechargeRecord);
                    this.Close();
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ex) { ShowError(ex); }
            finally
            {
                UnLockPage();
            }
        }
Exemple #27
0
        private void BaseButton_Search_Click(object sender, EventArgs e)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }


                int    brand   = Convert.ToInt32(ValidateUtil.CheckEmptyValue(this.skinComboBox_Brand.SelectedValue));
                string StrType = ValidateUtil.CheckEmptyValue(skinComboBoxGroup.SelectedValue);
                pagePara = new GetPfRetailAnalysisPara()
                {
                    PfCustomerID = ValidateUtil.CheckEmptyValue(this.pfCustomerComboBox1.SelectedValue),
                    CostumeID    = this.skinTextBoxID.SkinTxt.Text,
                    StartDate    = new CJBasic.Date(this.dateTimePicker_Start.Value),
                    EndDate      = new CJBasic.Date(this.dateTimePicker_End.Value),
                    BrandID      = brand,
                    SupplierID   = ValidateUtil.CheckEmptyValue(skinComboBoxSupplier.SelectedValue),
                    Type         = StrType,
                    ClassID      = (int)skinComboBoxBigClass.SelectedValue.ClassID,


                    //GroupType = (GroupType)skinComboBoxGroup.SelectedValue,
                    // IsGetGeneralStore = CommonGlobalCache.IsGeneralStoreRetail=="1"
                };

                //if (pagePara.GroupType == GroupType.Shop)
                //{
                //    ColumnDetail.Visible = true;
                //}
                //else
                //{
                //    ColumnDetail.Visible = false;
                //}

                InteractResult <PfRetailAnalysis> list = CommonGlobalCache.ServerProxy.GetPfRetailAnalysis(this.pagePara);

                /*   if (String.IsNullOrEmpty(pagePara.CostumeID))
                 * {
                 *     groupTypeNameDataGridViewTextBoxColumn.HeaderText = "分组";
                 * }
                 * else
                 * {
                 *     if (pagePara.ShopID == null)
                 *     {
                 *         groupTypeNameDataGridViewTextBoxColumn.HeaderText = "店鋪";
                 *     }
                 *     else
                 *     {
                 *         groupTypeNameDataGridViewTextBoxColumn.HeaderText = "款号";
                 *     }
                 * }*/
                String[] strs = StrType.Split('+');
                if (strs.Length == 1)
                {//款号
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = false;
                    TypeValue3.Visible    = false;
                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                    listColumn.Add(TypeValue4);
                    listColumn.Add(TypeValue5);
                    listColumn.Add(TypeValue6);
                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 2)
                {//供应商+款号、品牌 + 款号、日期 + 款号
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = false;
                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                    listColumn.Add(TypeValue4);
                    listColumn.Add(TypeValue5);
                    listColumn.Add(TypeValue6);
                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 3)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                    listColumn.Add(TypeValue4);
                    listColumn.Add(TypeValue5);
                    listColumn.Add(TypeValue6);
                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 4)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    TypeValue4.Visible    = true;
                    TypeValue4.HeaderText = strs[3];
                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();

                    listColumn.Add(TypeValue5);
                    listColumn.Add(TypeValue6);
                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }

                else
                if (strs.Length == 5)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    TypeValue4.Visible    = true;
                    TypeValue4.HeaderText = strs[3];
                    TypeValue5.Visible    = true;
                    TypeValue5.HeaderText = strs[4];
                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                    listColumn.Add(TypeValue6);
                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }

                else
                if (strs.Length == 6)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    TypeValue4.Visible    = true;
                    TypeValue4.HeaderText = strs[3];
                    TypeValue5.Visible    = true;
                    TypeValue5.HeaderText = strs[4];
                    TypeValue6.Visible    = true;
                    TypeValue6.HeaderText = strs[5];
                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                    listColumn.Add(TypeValue7);
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 7)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    TypeValue4.Visible    = true;
                    TypeValue4.HeaderText = strs[3];
                    TypeValue5.Visible    = true;
                    TypeValue5.HeaderText = strs[4];
                    TypeValue6.Visible    = true;
                    TypeValue6.HeaderText = strs[5];
                    TypeValue7.Visible    = true;
                    TypeValue7.HeaderText = strs[6];
                    List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                    listColumn.Add(TypeValue8);
                    SetVisible(listColumn);
                }
                else
                if (strs.Length == 8)
                {//日期 + 单号 + 供应商
                    TypeValue1.Visible    = true;
                    TypeValue1.HeaderText = strs[0];
                    TypeValue2.Visible    = true;
                    TypeValue2.HeaderText = strs[1];
                    TypeValue3.Visible    = true;
                    TypeValue3.HeaderText = strs[2];
                    TypeValue4.Visible    = true;
                    TypeValue4.HeaderText = strs[3];
                    TypeValue5.Visible    = true;
                    TypeValue5.HeaderText = strs[4];
                    TypeValue6.Visible    = true;
                    TypeValue6.HeaderText = strs[5];
                    TypeValue7.Visible    = true;
                    TypeValue7.HeaderText = strs[6];
                    TypeValue8.Visible    = true;
                    TypeValue8.HeaderText = strs[7];
                }

                if (!String.IsNullOrEmpty(pagePara.CostumeID))
                {
                    if (strs.Length == 1)
                    {//款号
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = false;
                        TypeValue3.Visible    = false;

                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue4);
                        listColumn.Add(TypeValue5);
                        listColumn.Add(TypeValue6);
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }
                    else
                    if (strs.Length == 2)
                    {//供应商+款号、品牌 + 款号、日期 + 款号
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = false;

                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue4);
                        listColumn.Add(TypeValue5);
                        listColumn.Add(TypeValue6);
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }
                    else
                    if (strs.Length == 3)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];

                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue4);
                        listColumn.Add(TypeValue5);
                        listColumn.Add(TypeValue6);
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }

                    else
                    if (strs.Length == 4)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];
                        TypeValue4.Visible    = true;
                        TypeValue4.HeaderText = strs[3];

                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue5);
                        listColumn.Add(TypeValue6);
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }

                    else
                    if (strs.Length == 5)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];
                        TypeValue4.Visible    = true;
                        TypeValue4.HeaderText = strs[3];
                        TypeValue5.Visible    = true;
                        TypeValue5.HeaderText = strs[4];
                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue6);
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }

                    else
                    if (strs.Length == 6)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];
                        TypeValue4.Visible    = true;
                        TypeValue4.HeaderText = strs[3];
                        TypeValue5.Visible    = true;
                        TypeValue5.HeaderText = strs[4];
                        TypeValue6.Visible    = true;
                        TypeValue6.HeaderText = strs[5];
                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue7);
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }
                    else
                    if (strs.Length == 7)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];
                        TypeValue4.Visible    = true;
                        TypeValue4.HeaderText = strs[3];
                        TypeValue5.Visible    = true;
                        TypeValue5.HeaderText = strs[4];
                        TypeValue6.Visible    = true;
                        TypeValue6.HeaderText = strs[5];
                        TypeValue7.Visible    = true;
                        TypeValue7.HeaderText = strs[6];
                        List <DataGridViewTextBoxColumn> listColumn = new List <DataGridViewTextBoxColumn>();
                        listColumn.Add(TypeValue8);
                        SetVisible(listColumn);
                    }
                    else
                    if (strs.Length == 8)
                    {//日期 + 单号 + 供应商
                        TypeValue1.Visible    = true;
                        TypeValue1.HeaderText = strs[0];
                        TypeValue2.Visible    = true;
                        TypeValue2.HeaderText = strs[1];
                        TypeValue3.Visible    = true;
                        TypeValue3.HeaderText = strs[2];
                        TypeValue4.Visible    = true;
                        TypeValue4.HeaderText = strs[3];
                        TypeValue5.Visible    = true;
                        TypeValue5.HeaderText = strs[4];
                        TypeValue6.Visible    = true;
                        TypeValue6.HeaderText = strs[5];
                        TypeValue7.Visible    = true;
                        TypeValue7.HeaderText = strs[6];
                        TypeValue8.Visible    = true;
                        TypeValue8.HeaderText = strs[7];
                    }
                }

                this.BindingDataSource(list.Data);
            }
            catch (Exception ex)
            {
                ShowError(ex);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #28
0
        public void Search()
        {
            try
            {
                isBarCode = false;
                string costumeID = this.Text.Trim();
                if (string.IsNullOrEmpty(costumeID))
                {
                    if (this.CostumeSelected != null)
                    {
                        curItem = null;
                        this.CostumeSelected(curItem, true);
                    }
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                //条形码,先根据条形码获取款号
                //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper()));

                ////,条形码为一条,找到这个款号
                //if (barCodes != null && barCodes.Count == 1)
                //{
                //    costumeID = barCodes[0].CostumeID;
                //    this.Text = barCodes[0].BarCodeValue;
                //    isBarCode = true;
                //}
                if (costumeID.Length == 15)
                {
                    BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID);
                    if (costume != null)
                    {
                        costumeID    = costume.CostumeID;
                        SkinTxt.Text = costume.BarCode;
                        isBarCode    = true;
                    }
                }

                List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => (t.ID.ToUpper().Contains(costumeID.ToUpper())));
                if (filterValid)
                {
                    resultList = resultList.FindAll(t => t.IsValid);
                }

                /*  CostumeItem t = new CostumeItem();
                 *
                 * List<CostumeItem> resultList = CommonGlobalCache.ServerProxy.GetCostumeStoreList(new CostumeStoreListPara()
                 * {
                 *    CostumeID = costumeID,
                 *    ShopID = this.ShopID,
                 *    IsOnlyShowValid = filterValid
                 * });
                 *
                 *
                 * //有供应商则过滤供应商
                 * if (SupplierID != null && resultList != null)
                 * {
                 *    resultList = resultList.FindAll(i => i.Costume.SupplierID == SupplierID);
                 * }*/
                if (resultList == null || resultList.Count == 0)
                {
                    if (this.CostumeSelected != null)
                    {
                        curItem = null;
                        this.CostumeSelected(curItem, true);
                    }
                    this.Text = "";
                    return;
                }
                if (resultList.Count == 1)
                {
                    if (!isBarCode)
                    {
                        this.Text = resultList[0].ID;
                    }
                    if (this.CostumeSelected != null)
                    {
                        Costume curCostume = resultList[0];
                        curItem = null; //根据条件获取库存信息

                        List <CostumeItem> selectResultItem = CommonGlobalCache.ServerProxy.GetCostumeStoreList(new CostumeStoreListPara()
                        {
                            CostumeID       = resultList[0].ID,
                            ShopID          = this.ShopID,
                            IsOnlyShowValid = filterValid,
                            IsAccurateQuery = true,
                        });

                        if (SupplierID != null && resultList != null)
                        {
                            selectResultItem = selectResultItem.FindAll(i => i.Costume.SupplierID == SupplierID);
                        }
                        if (selectResultItem.Count > 0)
                        {
                            this.CostumeSelected(selectResultItem[0], true);
                        }
                        else
                        {
                            this.Text = "";
                        }
                    }
                }
                else
                {
                    CostumeFromShopForm costumeForm = new CostumeFromShopForm(resultList, costumeID, ShopID, FilterValid, SupplierID);

                    if (costumeForm.ShowDialog() == DialogResult.OK)
                    {
                        if (costumeForm.Result == null)
                        {
                            return;
                        }
                        this.Text = costumeForm.Result.Costume.ID;
                        curItem   = costumeForm.Result;
                        CostumeSelected?.Invoke(curItem, true);
                    }
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #29
0
        private void SkinTxt_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            if (e.KeyCode != Keys.Enter)
            {
                return;
            }
            try
            {
                isBarCode = false;
                string costumeID = this.SkinTxt.Text.Trim();
                if (string.IsNullOrEmpty(costumeID))
                {
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(null);
                    }
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                //条形码,先根据条形码获取款号
                //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper()));

                ////,条形码为一条,找到这个款号
                //if (barCodes != null && barCodes.Count == 1)
                //{
                //    costumeID = barCodes[0].CostumeID;
                //    this.SkinTxt.Text = barCodes[0].BarCodeValue;
                //    isBarCode = true;
                //}
                if (costumeID.Length == 15)
                {
                    BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID);
                    if (costume != null)
                    {
                        costumeID    = costume.CostumeID;
                        SkinTxt.Text = costume.BarCode;
                        isBarCode    = true;
                    }
                }



                List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => t.ID.ToUpper().Contains(costumeID.ToUpper()) && t.IsValid == true);
                //  List<CostumeItem> resultList = GlobalCache.ServerProxy.GetPfCustomerStores("", costumeID);
                if (resultList == null || resultList.Count == 0)
                {
                    this.CostumeSelected?.Invoke(null);
                    //this.SkinTxt.Text = "";

                    return;
                }
                if (resultList.Count == 1)
                {
                    List <CostumeItem> OneresultList = GlobalCache.ServerProxy.GetPfCustomerStores(CustomerID, costumeID, true);
                    if (OneresultList.Count == 0)
                    {
                        CostumeItem createItem = new CostumeItem();

                        createItem.Costume          = resultList[0];
                        createItem.CostumeStoreList = SetupStores(resultList[0]);
                        OneresultList.Add(createItem);
                    }
                    OneresultList[0].Costume.BrandName    = CommonGlobalCache.GetBrandName(OneresultList[0].Costume.BrandID);
                    OneresultList[0].Costume.SupplierName = CommonGlobalCache.GetSupplierName(OneresultList[0].Costume.SupplierID);
                    if (OneresultList[0].CostumeStoreList != null)
                    {
                        foreach (var item in OneresultList[0].CostumeStoreList)
                        {
                            item.CostumeName = OneresultList[0].Costume.Name;
                            item.BrandName   = OneresultList[0].Costume.BrandName;
                            item.Price       = OneresultList[0].Costume.Price;
                        }
                    }


                    if (!isBarCode)
                    {
                        this.SkinTxt.Text = OneresultList[0].Costume.ID;
                    }
                    if (this.CostumeSelected != null)
                    {
                        this.CostumeSelected(OneresultList[0]);
                    }
                }
                else
                {
                    PfCostumeFromShopForm costumeForm = new PfCostumeFromShopForm(resultList, costumeID, CustomerID, filterValid);
                    //   costumeForm.Hide();
                    // costumeForm.CostumeSelected += CostumeForm_CostumeSelected;
                    if (costumeForm.ShowDialog() == DialogResult.OK)
                    {
                        if (costumeForm.Result == null)
                        {
                            return;
                        }
                        this.SkinTxt.Text = costumeForm.Result.Costume.ID;
                        CostumeSelected?.Invoke(costumeForm.Result);
                    }
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
        private void BaseButton1_Click(object sender, EventArgs e)
        {
            try
            {
                string costumeID = this.skinTextBox1.SkinTxt.Text.Trim();
                if (string.IsNullOrEmpty(costumeID))
                {
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                //条形码,先根据条形码获取款号
                //List<BarCode> barCodes = CommonGlobalCache.BarCodeList?.FindAll(t => t.BarCodeValue.ToUpper().Equals(costumeID.ToUpper()));

                ////,条形码为一条,找到这个款号
                //if (barCodes != null && barCodes.Count == 1)
                //{
                //    costumeID = barCodes[0].CostumeID;
                //    this.skinTextBox1.SkinTxt.Text = barCodes[0].BarCodeValue;
                //}
                if (costumeID.Length == 15)
                {
                    BarCode4Costume costume = CommonGlobalUtil.GetBarCode(costumeID);
                    if (costume != null)
                    {
                        costumeID = costume.CostumeID;
                        skinTextBox1.SkinTxt.Text = costume.BarCode;
                        //  isBarCode = true;
                    }
                }

                /*  List<Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => (t.ID.ToUpper().Contains(costumeID.ToUpper())));
                 * if (filterValid)
                 * {
                 *    resultList = resultList.FindAll(t => t.IsValid);
                 * }*/
                List <Costume> resultList = CommonGlobalCache.CostumeList.FindAll(t => t.ID.ToUpper().Contains(costumeID.ToUpper()) && t.IsValid == true);
                //  List<CostumeItem> resultList = currentCostumeitems.FindAll(t => t.Costume.ID.ToUpper().Contains(costumeID.ToUpper()));

                /*   List<CostumeItem> resultList = CommonGlobalCache.ServerProxy.GetCostumeStoreList(
                 *     new CostumeStoreListPara() { CostumeID = costumeID, ShopID = this.ShopID,
                 *         IsOnlyShowValid = filterValid,
                 *        // IsAccurateQuery = true,
                 *     });*/

                // this.currentSource.Clear();
                // this.currentSource = resultList;

                /* foreach (CostumeItem cItem in resultList)
                 * {
                 *   currentSource.Add(cItem.Costume);
                 * }*/

                this.SetDataSource(resultList);
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }

            finally
            {
                UnLockPage();
            }
        }