Exemplo n.º 1
0
        private void skinComboBoxShopID_SelectedIndexChanged(object sender, EventArgs e)
        {
            string supplierId = ValidateUtil.CheckEmptyValue(skinComboBox_PfCustomer.SelectedValue);

            if (!String.IsNullOrEmpty(selectedSupplierID) && selectedSupplierID != supplierId && curInboundDetailList != null && curInboundDetailList.Count > 0)
            {
                List <PfOrderDetail> pfDetails = new List <PfOrderDetail>();
                foreach (var item in curInboundDetailList)
                {
                    item.CustomerID = supplierId;
                    //item.CustomerName = GlobalCache(item.CustomerID);
                    Costume citem = GlobalCache.GetCostume(item.CostumeID);
                    if (pfCustomer != null)
                    {
                        item.CustomerName = pfCustomer.Name;
                        item.PfPrice      = citem.Price == 0 ? 0 : Math.Round(citem.Price * pfCustomer.PfDiscount * (decimal)0.01, 2, MidpointRounding.AwayFromZero);
                    }
                    pfDetails.Add(item);
                }
                this.curInboundDetailList.Clear();
                this.curInboundDetailList = pfDetails;
                // dataGridViewPagingSumCtrl3.BindingDataSource<PfOrderDetail>(this.curInboundDetailList);
                dataGridViewPagingSumCtrl2.BindingDataSource <PfOrderDetail>(this.curInboundDetailList);
                dataGridViewPagingSumCtrl2.ScrollToEnd();
            }
            if (skinComboBox_PfCustomer.SelectedItem != null)
            {
                skinLabel1Account.Text = "账套:" + (skinComboBox_PfCustomer.SelectedItem as PfCustomer)?.BusinessAccountID;
            }
            selectedSupplierID = supplierId;
        }
Exemplo n.º 2
0
        private void LoadOrder(PurchaseOrder order)
        {
            this.order = order;
            if (order != null)
            {
                skinTextBox_Remarks.Text = order.Remarks;
                //冲单重做
                skinComboBoxShopID.SelectedValue = order.DestShopID;
                if (shop == null)
                {
                    GlobalMessageBox.Show("店铺无效!");
                }

                curDetailList.Clear();
                BindingOutboundDetailSource();
                dateTimePicker_Start.Value           = order.CreateTime;
                numericTextBoxMoney.Value            = order.PayMoney;
                skinComboBoxSupplierID.SelectedValue = order.SupplierID;
                curDetailList = GlobalCache.ServerProxy.GetPurchaseDetails(order.ID);
                foreach (var detail in curDetailList)
                {
                    detail.SupplierName = GlobalCache.GetSupplierName(detail.SupplierID);
                    detail.Discount     = detail.Price == 0 ? 0 : Math.Round(detail.CostPrice * 100 / detail.Price, MidpointRounding.AwayFromZero);
                }
            }
        }
Exemplo n.º 3
0
        private void skinComboBoxShopID_SelectedIndexChanged(object sender, EventArgs e)
        {
            string supplierId = ValidateUtil.CheckEmptyValue(skinComboBox_PfCustomer.SelectedValue);

            if (!String.IsNullOrEmpty(selectedSupplierID) && selectedSupplierID != supplierId && curInboundDetailList != null && curInboundDetailList.Count > 0)
            {
                List <PfOrderDetail> pfDetails = new List <PfOrderDetail>();
                foreach (var item in curInboundDetailList)
                {
                    item.CustomerID   = supplierId;
                    item.CustomerName = pfCustomer.Name;

                    Costume citem = GlobalCache.GetCostume(item.CostumeID);
                    item.PfPrice =
                        citem.Price == 0 ? 0 : Math.Round(citem.Price * pfCustomer.PfDiscount * (decimal)0.01, 2, MidpointRounding.AwayFromZero);
                    pfDetails.Add(item);
                }
                this.curInboundDetailList.Clear();
                this.curInboundDetailList = pfDetails;
                dataGridViewPagingSumCtrl2.BindingDataSource <PfOrderDetail>(DataGridViewUtil.ListToBindingList(this.curInboundDetailList));
                // dataGridViewPagingSumCtrl3.BindingDataSource<PfOrderDetail>(DataGridViewUtil.ListToBindingList(this.curInboundDetailList));
                dataGridViewPagingSumCtrl2.ScrollToEnd();


                /*  GlobalMessageBox.Show("请选择相同的客户!");
                 * skinComboBox_PfCustomer.SelectedValue = selectedSupplierID;
                 * return;*/
            }
            selectedSupplierID = supplierId;
            //   this.costumeFromSupplierTextBox1.SupplierID = supplierId;
        }
Exemplo n.º 4
0
        /// <summary>
        /// 绑定plenishOrderSource源到dataGridView中
        /// </summary>
        /// <param name="listPage"></param>
        private void BindingReturnOrderSource(ReturnOrderPage listPage)
        {
            //   this.dataGridViewPagingSumCtrl.SetDataSource<PurchaseOrder>(null);
            if (listPage != null && listPage.ReturnOrderList != null && listPage.ReturnOrderList.Count > 0)
            {
                List <PurchaseOrder> details = listPage.ReturnOrderList;
                foreach (var item in details)
                {
                    if (item.AdminUserID != null)
                    {
                        try
                        {
                            item.UserName = GlobalCache.GetUserName(item.AdminUserID);
                        } catch (Exception ex)
                        {
                            item.UserName = "";
                        }
                    }
                    if (item.SupplierID != null)
                    {
                        item.SupplierName = GlobalCache.GetSupplierName(item.SupplierID);
                    }
                    item.DestShopName = GlobalCache.GetShopName(item.DestShopID);
                }
            }

            this.dataGridViewPagingSumCtrl.BindingDataSource(listPage?.ReturnOrderList, null, listPage?.TotalEntityCount, listPage?.ReturnOrderSum);
            this.skinSplitContainer1.Panel2Collapsed = true;
        }
Exemplo n.º 5
0
 /// <summary>
 /// 将CostumeStore转化为OutboundDetail
 /// </summary>
 /// <param name="store"></param>
 /// <returns></returns>
 private BoundDetail CostumeStoreConvertToOutboundDetail(CostumeStore store)
 {
     if (store == null)
     {
         return(null);
     }
     return(new BoundDetail()
     {
         CostumeID = store.CostumeID,
         CostumeName = GlobalCache.GetCostumeName(store.CostumeID),
         ColorName = store.ColorName,
         XS = store.XS,
         S = store.S,
         M = store.M,
         L = store.L,
         F = store.F,
         XL = store.XL,
         XL2 = store.XL2,
         XL3 = store.XL3,
         XL4 = store.XL4,
         XL5 = store.XL5,
         XL6 = store.XL6,
         Price = store.Price,
         CostPrice = store.CostPrice,
         Comment = store.Remarks
     });
 }
Exemplo n.º 6
0
        /// <summary>
        /// 将CostumeStore转化为ReplenishDetail
        /// </summary>
        /// <param name="store"></param>
        /// <returns></returns>
        private ReplenishDetail CostumeStoreConvertToReplenishDetail(CostumeStore store, string replenishOrderID)
        {
            if (store == null)
            {
                return(null);
            }

            ReplenishDetail detail = new ReplenishDetail();


            return(new ReplenishDetail()
            {
                ReplenishOrderID = replenishOrderID,
                CostumeID = store.CostumeID,
                CostumeName = GlobalCache.GetCostumeName(store.CostumeID),
                ColorName = store.ColorName,
                CostPrice = store.CostPrice,
                XS = store.XS,
                S = store.S,
                M = store.M,
                L = store.L,
                F = store.F,
                XL = store.XL,
                XL2 = store.XL2,
                XL3 = store.XL3,
                XL4 = store.XL4,
                XL5 = store.XL5,
                XL6 = store.XL6,
                Price = store.Price
            });
        }
Exemplo n.º 7
0
 //将绑定的RetailDetail源转换成RefundDetail
 private RetailDetail RetailDetailToRefundDetail(RetailDetail retailDetail, string orderID)
 {
     return(new RetailDetail()
     {
         RetailOrderID = orderID,
         CostumeID = retailDetail.CostumeID,
         CostumeName = GlobalCache.GetCostumeName(retailDetail.CostumeID),
         ColorName = retailDetail.ColorName,
         SizeName = retailDetail.SizeName,
         Discount = retailDetail.Discount,
         DiscountOrigin = retailDetail.DiscountOrigin,
         IsRefund = true,
         Price = retailDetail.Price,
         BuyCount = retailDetail.RefundCount * -1,
         IsBuyout = retailDetail.IsBuyout,
         BrandName = ValidateUtil.CheckNotNullValue(retailDetail.BrandName),
         GiftTicketMoney = retailDetail.GiftTicketMoney,
         //268 畅滞排行榜:商品退货后,零售金额变成0
         //20180820 summoney 修改为除以购买数量再乘以退货数量
         SalePrice = Math.Round((retailDetail.SumMoney / retailDetail.BuyCount) * -1, 1, MidpointRounding.AwayFromZero),//每件商品退货单价
         SumMoney = Math.Round(retailDetail.RefundCount * (retailDetail.SumMoney / retailDetail.BuyCount) * -1, 1, MidpointRounding.AwayFromZero),
         SumMoneyActual = Math.Round(retailDetail.RefundCount * retailDetail.Price * -1, 1, MidpointRounding.AwayFromZero),
         SizeDisplayName = retailDetail.SizeDisplayName,
         //retailDetail.RefundCount * retailDetail.Price * -1,
         CostPrice = retailDetail.CostPrice * -1,
         SumCost = retailDetail.RefundCount * retailDetail.CostPrice * -1,
         Remarks = retailDetail.Remarks,
         InSalesPromotion = retailDetail.InSalesPromotion,
         GiftTickets = retailDetail.GiftTickets,
         RefundCount = retailDetail.RefundCount,
         OccureTime = dateTimePicker_Start.Value,
         GuideID = retailDetail.GuideID,
     });
 }
Exemplo n.º 8
0
        private void BaseButton_TakeInteger_Click(object sender, EventArgs e)
        {
            try
            {
                decimal newSmallMoneyRemoved = decimal.Parse(this.skinTextBox_TakeInteger.SkinTxt.Text);
                if (newSmallMoneyRemoved > GlobalCache.GetShop(this.shopID).MaxChangeRemoved)
                {
                    GlobalMessageBox.Show(string.Format("抹零金额不能大于店铺的最大抹零金额:{0}元", GlobalCache.GetShop(this.shopID).MaxChangeRemoved));
                    return;
                }

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

                this.skinLabel_TakeIntegerMoney.Text = this.m_SmallMoneyRemoved.ToString();
                this.totalMoneyReceived = this.totalMoneyReceived + oldSmallMoneyRemoved - this.m_SmallMoneyRemoved;
                this.skinLabel_TotalMoneySupposed.Text = this.totalMoneyReceived.ToString();
                this.skinLabel_MoneyChange.Text        = this.moneyChange.ToString();
                this.moneyChange = this.moneyChange - oldSmallMoneyRemoved + this.m_SmallMoneyRemoved;
                this.skinTextBox_TakeInteger.SkinTxt.Text = "";
                UpdateMoneyValue();
            }
            catch (Exception ee)
            {
                GlobalUtil.WriteLog(ee);
                GlobalMessageBox.Show("抹零金额格式不正确");
            }
        }
Exemplo n.º 9
0
        public static List <TreeNode> GetTreeNodes()
        {
            List <TreeNode>         nodes = new List <TreeNode>();
            List <CostumeClassInfo> infos = GlobalCache.GetCostumeClassList();
            TreeNode rootNode             = new TreeNode("所有商品");

            rootNode.ImageIndex = 0;
            rootNode.Expand();
            foreach (CostumeClassInfo item in infos)
            {
                TreeNode level1 = new TreeNode(item.BigClass);
                level1.ImageIndex = 1;
                level1.Tag        = item;
                if (item.SmallClass != null)
                {
                    foreach (SmallClass smallClass in item.SmallClass)
                    {
                        TreeNode level2 = new TreeNode(smallClass.SmallClassStr);
                        level2.ImageIndex = 2;
                        level2.Tag        = smallClass;
                        foreach (SubSmallClass subSmallClass in smallClass.SubSmallClass)
                        {
                            TreeNode level3 = new TreeNode(subSmallClass.SubSmallClassStr);
                            level3.ImageIndex = 3;
                            level3.Tag        = subSmallClass;
                            level2.Nodes.Add(level3);
                        }
                        level1.Nodes.Add(level2);
                    }
                }
                rootNode.Nodes.Add(level1);
            }
            nodes.Add(rootNode);
            return(nodes);
        }
Exemplo n.º 10
0
 /// <summary>
 /// 绑定RetailDetail数据源并设置下方的Label值
 /// </summary>
 private void BindingDataSource(
     CostumeRetailAnalysisPage listPage)
 {
     this.dataGridViewDetail.DataSource = null;
     if (listPage != null && listPage.CostumeRetailAnalysisList != null)
     {
         foreach (CostumeRetailAnalysis item in listPage.CostumeRetailAnalysisList)
         {
             Costume costume = GlobalCache.GetCostume(item.CostumeID);
             //按款查询需要前端补充颜色信息
             if (string.IsNullOrEmpty(item.ColorName))
             {
                 item.ColorName = costume.Colors;
             }
             item.Price       = costume.Price;
             item.BigClass    = costume.BigClass;
             item.SmallClass  = costume.SmallClass;
             item.Season      = costume.Season;
             item.Year        = costume.Year;
             item.CostumeName = costume.Name;
             item.BrandName   = GlobalCache.GetBrandName(costume.BrandID);
             item.ShopName    = GlobalCache.GetShopName(item.ShopID);
             decimal totalPrice = item.Price * item.QuantityOfSale;
             if (totalPrice == 0)
             {
                 item.AvgDiscount = 100;
             }
             else
             {
                 item.AvgDiscount = MathHelper.Rounded(item.MoneyOfSale / totalPrice, 2);
             }
         }
         this.dataGridViewDetail.DataSource = listPage?.CostumeRetailAnalysisList;
     }
 }
Exemplo n.º 11
0
 private void Initialize()
 {
     if (this.curReplenishOrder == null)
     {
         return;
     }
     try
     {
         DataGridViewUtil.SetAlternatingColor(dataGridView1, Color.Gainsboro, Color.White);
         this.skinTextBox_OrderID.Text = "补货申请单号:" + this.curReplenishOrder.ID;
         this.skinLabel_ShopName.Text  = "店铺名称:" + GlobalCache.GetShopName(this.curReplenishOrder.ShopID);
         curReplenishDetailList        = GlobalCache.ServerProxy.GetReplenishDetail(this.curReplenishOrder.ID);
         foreach (var item in curReplenishDetailList)
         {
             Costume costume = CommonGlobalCache.GetCostume(item.CostumeID);
             if (costume != null)
             {
                 item.CostPrice = costume.CostPrice;
             }
         }
         this.BindingSource(curReplenishDetailList);
     }
     catch (Exception ex)
     {
         GlobalUtil.ShowError(ex);
     }
 }
Exemplo n.º 12
0
        /// <summary>
        /// 绑定RefundDetail数据源
        /// </summary>
        private void BindingRefundDetailDataSource(RetailOrder refundOrder)
        {
            if (refundOrder == null)
            {
                this.dataGridView_RefundDetail.DataSource = null;
            }
            else
            {
                List <RetailDetail> refundDetailList = GlobalCache.ServerProxy.GetRetailDetailList(refundOrder.ID);
                this.dataGridView_RefundDetail.DataSource = null;
                if (refundDetailList != null && refundDetailList.Count > 0)
                {
                    foreach (RetailDetail detail in refundDetailList)
                    {
                        detail.CostumeName     = GlobalCache.GetCostumeName(detail.CostumeID);
                        detail.SizeDisplayName = CommonGlobalUtil.GetCostumeSizeName(detail.CostumeID, detail.SizeName);
                    }

                    this.dataGridView_RefundDetail.DataSource = refundDetailList;
                }
            }

            this.dataGridView_RefundDetail.Refresh();
            this.dataGridView_RefundDetail.Visible = true;
        }
Exemplo n.º 13
0
        private void Delete(List <Brand> list, Brand item)
        {
            if (GlobalMessageBox.Show("是否确认操作?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
            {
                return;
            }

            if (GlobalUtil.EngineUnconnectioned(this))
            {
                return;
            }
            this.dataGridView1.DataSource = null;
            InteractResult result = GlobalCache.Brand_OnRemove(item.AutoID);

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

            default:
                this.dataGridView1.DataSource = null;
                list.Remove(item);
                this.dataGridView1.DataSource = DataGridViewUtil.ListToBindingList(list);
                break;
            }
            this.dataGridView1.DataSource = DataGridViewUtil.ListToBindingList(list);
        }
Exemplo n.º 14
0
        private void skinLabelAdd_Click(object sender, EventArgs e)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                CostumeAddBrandForm addForm = new CostumeAddBrandForm();
                if (addForm.ShowDialog(this) == DialogResult.OK)
                {
                    List <Brand> list = (List <Brand>) this.skinComboBox.DataSource;
                    if (list == null)
                    {
                        list = new List <Brand>();
                    }
                    Brand value = addForm.Result;
                    //从所有品牌中查找
                    Brand listItem = CommonGlobalCache.BrandList.Find(t => t.Name == value.Name);
                    if (listItem == null)
                    {
                        //   Brand item = new Brand() { Name = value, FirstCharSpell = DisplayUtil.GetPYString(value) };
                        InsertResult result = GlobalCache.BrandList_OnInsert(value);
                        switch (result)
                        {
                        case InsertResult.Success:
                            this.skinComboBox.DataSource = null;
                            list.Add(value);
                            this.skinComboBox.DisplayMember = "Name";
                            this.skinComboBox.ValueMember   = "AutoID";
                            this.skinComboBox.DataSource    = list;
                            this.skinComboBox.SelectedIndex = list.IndexOf(value);
                            break;

                        case InsertResult.Error:
                            break;

                        default:
                            break;
                        }
                    }
                    else
                    {
                        GlobalMessageBox.Show("品牌已存在");
                        //this.skinComboBox.SelectedItem = listItem;
                    }
                }
            }
            catch (Exception ex)
            {
                // GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Exemplo n.º 15
0
 /// <summary>
 /// 将集合中GuideName赋值
 /// </summary>
 /// <param name="memberList"></param>
 private void SetOtherValue(List <Costume> list)
 {
     foreach (Costume item in list)
     {
         String name = GlobalCache.GetSupplierName(item.SupplierID);
         item.SupplierName = name;
         item.BrandName    = GlobalCache.GetBrandName(item.BrandID);
     }
 }
Exemplo n.º 16
0
        /// <summary>
        /// 绑定选定款号对应的CostumeStore集合
        /// </summary>
        private void BindingSelectedCostumeStoreSource()
        {
            if (this.curSelectedCostumeStoreList == null)
            {
                this.dataGridView1.DataSource = null;
            }
            else
            {
                dataGridViewPagingSumCtrl.DisableStyle();
                this.dataGridView1.DataSource = null;
                if (this.curSelectedCostumeStoreList != null && this.curSelectedCostumeStoreList.Count > 0)
                {
                    List <CostumeStore> tempList = new List <CostumeStore>();
                    foreach (CostumeStore store in this.curSelectedCostumeStoreList)
                    {
                        store.Title       = "库存";
                        store.CostumeName = GlobalCache.GetCostumeName(store.CostumeID);
                        CostumeStore tempStore = this.BuildCostumeStore4NeedReplenish(store);
                        //CJBasic.Helpers.ReflectionHelper.CopyProperty(store, obj);
                        tempList.Add(store);
                        tempList.Add(tempStore);
                    }
                    this.curSelectedCostumeStoreList = tempList;

                    ////重新排序,同款同颜色排一起,且将补货数量拍在库存后面
                    //this.curSelectedCostumeStoreList.Sort((x, y) =>
                    //{
                    //    int sort = x.ColorName.CompareTo(y.ColorName);
                    //    if (sort == 0)
                    //    {
                    //        sort = -x.Title.CompareTo(y.Title);
                    //    }
                    //    return sort;
                    //});
                    this.dataGridView1.DataSource = this.curSelectedCostumeStoreList;
                    foreach (DataGridViewRow row in dataGridView1.Rows)
                    {
                        if (row.Index % 2 == 0)
                        {
                            row.ReadOnly         = true;
                            row.HeaderCell.Value = "库存";
                        }
                        else
                        {
                            row.ReadOnly         = false;
                            row.HeaderCell.Value = "补货申请";
                        }
                    }

                    dataGridViewPagingSumCtrl.EnableStyle();
                }
            }
            this.dataGridView1.Refresh();
            dataGridViewPagingSumCtrl.AutoFocusToWritableCell();
        }
Exemplo n.º 17
0
 /// <summary>
 /// 绑定要补货的集合源
 /// </summary>
 private void BindingReplenishDetailSource()
 {
     if (this.curReplenishDetailList != null && this.curReplenishDetailList.Count > 0)
     {
         foreach (ReplenishDetail detail in this.curReplenishDetailList)
         {
             detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID);
         }
     }
     dataGridViewPagingSumCtrl2.BindingDataSource <ReplenishDetail>(this.curReplenishDetailList);
 }
Exemplo n.º 18
0
 /// <summary>
 /// 绑定要报损的集合源
 /// </summary>
 private void BindingOutboundDetailSource()
 {
     if (this.curOutboundDetailList != null && this.curOutboundDetailList.Count > 0)
     {
         foreach (BoundDetail detail in this.curOutboundDetailList)
         {
             detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID);
         }
     }
     dataGridViewPagingSumCtrl2.BindingDataSource <BoundDetail>(DataGridViewUtil.ListToBindingList(this.curOutboundDetailList));
 }
Exemplo n.º 19
0
 private void BindingDataSource(CarriageCostTemplatePage listPage)
 {
     if (listPage != null && listPage.CarriageCostTemplates != null)
     {
         foreach (var item in listPage.CarriageCostTemplates)
         {
             item.LastOperatorUserName = GlobalCache.GetUserName(item.LastOperatorUserID);
         }
     }
     this.dataGridViewPagingSumCtrl.BindingDataSource(listPage?.CarriageCostTemplates, null, listPage?.TotalEntityCount);
 }
Exemplo n.º 20
0
 private void Initialize()
 {
     // GlobalUtil.SetSupplier(this.skinComboBox_SupplierID, true, true);
     this.numericTextBox1.Value = 0;
     numericTextBox1.MinNum     = decimal.MinValue;
     if (GlobalCache.GetParameter(ParameterConfigKey.IsHidePayment).ParaValue == "1")
     {
         BaseButtonEdit.Enabled = false;
         baseButtonEnd.Visible  = false;
     }
 }
Exemplo n.º 21
0
 private void Initialize()
 {
     skinComboBox_PfCustomer.Initialize(true, true);
     this.numericTextBox1.Value = 0;
     numericTextBox1.MinNum     = decimal.MinValue;
     if (GlobalCache.GetParameter(ParameterConfigKey.IsHidePfPayment).ParaValue == "1")
     {
         BaseButtonEdit.Enabled = false;
         baseButtonEnd.Visible  = false;
     }
 }
Exemplo n.º 22
0
 private void BindingSource(List <BoundDetail> list)
 {
     this.dataGridView2.DataSource = null;
     if (list != null && list.Count > 0)
     {
         foreach (BoundDetail detail in list)
         {
             detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID);
         }
         this.dataGridView2.DataSource = DataGridViewUtil.ListToBindingList(list);
     }
 }
Exemplo n.º 23
0
 //将绑定的PfCustomerRetailDetail源转换成RefundDetail
 private PfCustomerRetailDetail PfCustomerRetailDetailToRefundDetail(PfCustomerRetailDetail PfCustomerRetailDetail, string orderID)
 {
     return(new PfCustomerRetailDetail()
     {
         CostumeID = PfCustomerRetailDetail.CostumeID,
         CostumeName = GlobalCache.GetCostumeName(PfCustomerRetailDetail.CostumeID),
         ColorName = PfCustomerRetailDetail.ColorName,
         SizeName = PfCustomerRetailDetail.SizeName,
         BuyCount = PfCustomerRetailDetail.BuyCount,
         SizeDisplayName = PfCustomerRetailDetail.SizeDisplayName,
     });
 }
Exemplo n.º 24
0
        private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            DataGridViewRow row  = dataGridView1.Rows[e.RowIndex];
            CostumeStore    item = (CostumeStore)row.DataBoundItem;

            if (row.DataBoundItem != null)
            {
                if (costumeNameDataGridViewTextBoxColumn.Index == e.ColumnIndex)
                {
                    e.Value = GlobalCache.GetCostumeName(item.CostumeID);
                }
            }
        }
Exemplo n.º 25
0
 private void BindingSource(List <ReplenishDetail> list)
 {
     this.dataGridView2.DataSource = null;
     if (list != null && list.Count > 0)
     {
         foreach (ReplenishDetail detail in list)
         {
             detail.CostumeName = GlobalCache.GetCostumeName(detail.CostumeID);
         }
         dataGridViewPagingSumCtrl2.BindingDataSource <ReplenishDetail>(list);
         // this.dataGridView2.DataSource = list;
     }
 }
Exemplo n.º 26
0
        private void Edit(Brand item)
        {
            CostumeAddBrandForm AddBrand = new CostumeAddBrandForm(item, OperationEnum.Edit);

            try
            {
                if (AddBrand.ShowDialog(this) == DialogResult.OK)
                {
                    if (GlobalUtil.EngineUnconnectioned(this))
                    {
                        return;
                    }
                    InteractResult result = GlobalCache.ServerProxy.UpdateBrand(item);
                    switch (result.ExeResult)
                    {
                    case ExeResult.Success:
                        GlobalCache.UpdateBrand(item);
                        baseButton1_Click(null, null);
                        break;

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

                    default:
                        break;
                    }
                    //UpdateResult result = GlobalCache.ServerProxy.UpdateBrand(item);
                    //switch (result)
                    //{
                    //    case UpdateResult.Success:
                    //        GlobalCache.UpdateBrand(item);
                    //        baseButton1_Click(null, null);
                    //        break;
                    //    case UpdateResult.Error:
                    //        GlobalMessageBox.Show("内部错误!");
                    //        break;
                    //    default:
                    //        break;
                    //}
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
        private void BindingSource(SupplierAccountRecordPage listPage)
        {
            if (listPage != null && listPage.SupplierAccountRecords != null && listPage.SupplierAccountRecords.Count > 0)
            {
                foreach (var item in listPage.SupplierAccountRecords)
                {
                    item.SupplierName    = GlobalCache.GetSupplierName(item.SupplierID);
                    item.AdminUserName   = GlobalCache.GetUserName(item.AdminUserID);
                    item.AccountTypeName = GlobalUtil.GetAccountTypeName(item.AccountType);
                }
            }

            this.dataGridViewPagingSumCtrl.BindingDataSource(listPage.SupplierAccountRecords, null, listPage?.TotalEntityCount, listPage?.Sum);
        }
Exemplo n.º 28
0
        private BoundDetail CostumeStoreConvertToOutboundDetail(CostumeStore store, string replenishOrderID)
        {
            if (store == null)
            {
                return(null);
            }
            Costume     costume     = GlobalCache.GetCostume(store.CostumeID);
            BoundDetail boundDetail = new BoundDetail();

            ReflectionHelper.CopyProperty(costume, boundDetail);
            ReflectionHelper.CopyProperty(store, boundDetail);
            boundDetail.SupplierID = ValidateUtil.CheckEmptyValue(this.skinComboBoxSupplierID.SelectedValue);
            return(boundDetail);
        }
Exemplo n.º 29
0
        /// <summary>
        /// 生成ReplenishCostume对象
        /// </summary>
        /// <returns></returns>
        private ReplenishCostume BuildReplenishCostume()
        {
            if (this.curReplenishDetailList == null || this.curReplenishDetailList.Count == 0)
            {
                return(null);
            }

            string id = IDHelper.GetID(OrderPrefix.ReplenishOrder, GlobalCache.GetShop(shopID).AutoCode);

            if (action == OperationEnum.Pick)
            {
                id = this.order?.ID;
            }
            int     totalCount          = 0;
            decimal totalMoney          = 0;
            List <ReplenishDetail> list = new List <ReplenishDetail>();

            for (int i = 0; i < this.curReplenishDetailList.Count; i++)
            {
                if (this.curReplenishDetailList[i].SumCount == 0)
                {
                    continue;
                }
                list.Add(this.curReplenishDetailList[i]);
                totalCount += this.curReplenishDetailList[i].SumCount;
                totalMoney += this.curReplenishDetailList[i].SumMoney;
                this.curReplenishDetailList[i].ReplenishOrderID = id;
            }

            ReplenishOrder replenishOrder = new ReplenishOrder()
            {
                ID             = id,
                RequestGuideID = GlobalCache.CurrentUserID,// (string)this.guideComboBox1.SelectedValue,
                ShopID         = shopID,
                Remarks        = this.skinTextBox_Remarks.SkinTxt.Text,
                State          = (byte)ReplenishOrderState.NotProcessing,
                TotalCount     = totalCount,
                TotalPrice     = totalMoney,
                CreateTime     = DateTime.Now,
                FinishedTime   = SystemDefault.DateTimeNull,
            };

            return(new ReplenishCostume()
            {
                ReplenishOrder = replenishOrder,
                ReplenishDetailList = list
            });
        }
Exemplo n.º 30
0
        private void BindingOutboundDetailSource()
        {
            if (this.curDetailList != null && this.curDetailList.Count > 0)
            {
                foreach (BoundDetail detail in this.curDetailList)
                {
                    Costume curCostume = GlobalCache.GetCostume(detail.CostumeID);
                    detail.CostumeName = curCostume.Name;
                    detail.BrandName   = GlobalCache.GetBrandName(curCostume.BrandID);
                    detail.Year        = curCostume.Year;
                    detail.Season      = curCostume.Season;
                }
            }

            dataGridViewPagingSumCtrl2.BindingDataSource <BoundDetail>(DataGridViewUtil.ListToBindingList(curDetailList));
        }