Пример #1
0
        //  private List<CostumeStore> addValue = new List<CostumeStore>();

        private void SetDataGridData()
        {
            if (selectSizeGroup.Items.Count > 0)
            {
                List <string> disNames = selectSizeGroup.DisplayItems;
                List <string> Names    = selectSizeGroup.Items;

                List <PfCustomerStore> stores       = new List <PfCustomerStore>();
                PfCustomerStore        costumeStore = new PfCustomerStore();
                //  stores.Add();

                for (int j = 0; j < this.dataGridView2.Columns.Count; j++)
                {
                    bool flag = true;
                    for (int k = 0; k < selectSizeGroup.Items.Count; k++)
                    {
                        if (this.dataGridView2.Columns[j].DataPropertyName == selectSizeGroup.Items[k])
                        {
                            this.dataGridView2.Columns[j].HeaderText = disNames[k];
                            this.dataGridView2.Columns[j].Visible    = true;
                            flag = false;
                        }
                    }
                    if (flag)
                    {
                        this.dataGridView2.Columns[j].Visible = false;
                    }
                }

                //dataGridView2.DataSource = addValue
            }
        }
Пример #2
0
        private CostumeStoreExcel GetCostumeStoreExcel(PfCustomerStore item)
        {
            CostumeStoreExcel excel = new CostumeStoreExcel();

            ReflectionHelper.CopyProperty(item, excel);
            return(excel);
        }
Пример #3
0
        public WholesaleBeginningSaveCostumeForm(PfCustomerStore store)
        {
            try
            {
                InitializeComponent();
                this.curStore = store;

                this.action = OperationEnum.Edit;
                Costume costume = GlobalCache.GetCostume(store.CostumeID);
                if (costume != null)
                {
                    this.CurItem = costume;
                }
                else
                {
                    costume = new Costume();
                    ReflectionHelper.CopyProperty(store, costume);
                    costume.ID      = store.CostumeID;
                    costume.Name    = store.CostumeName;
                    costume.Colors  = store.ColorName;
                    this.CurItem    = costume;
                    this.customerID = store.PfCustomerID;
                }
                SetSize();
            }
            catch (Exception ex) {
                GlobalUtil.ShowError(ex);
            }
        }
Пример #4
0
        private Boolean CheckDuplicates(List <PfCustomerStore> stores)
        {
            bool add = true;
            List <PfCustomerStore> details = new List <PfCustomerStore>();

            foreach (var detail in stores)
            {  //判断是否存在相同款号颜色,如果有则提示是否累加,确定就累加原来的,否的话则取消
                if (curInboundDetailList.Exists(t => t.PfCustomerID == detail.PfCustomerID && t.CostumeID == detail.CostumeID && t.ColorName == detail.ColorName))
                {
                    details.Add(detail);
                }
            }

            if (details != null && details.Count > 0)
            {
                String value = string.Empty;
                foreach (var item in details)
                {
                    value = item.CostumeID + " " + item.ColorName + "\r\n";
                }

                if (GlobalMessageBox.Show(value + "已存在,是否覆盖?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    foreach (var detail in stores)
                    {
                        if (details.Contains(detail))
                        {
                            PfCustomerStore existDetail = curInboundDetailList.Find(t => t.PfCustomerID == detail.PfCustomerID && t.CostumeID == detail.CostumeID && t.ColorName == detail.ColorName);
                            //  dataGridViewPagingSumCtrl(curInboundDetailList.IndexOf(existDetail));
                            ReflectionHelper.CopyProperty(detail, existDetail);
                        }
                        else
                        {
                            curInboundDetailList.Add(detail);
                        }
                    }
                }
                else
                {
                    add = false;
                }
            }
            else
            {
                curInboundDetailList.AddRange(stores);
            }
            //
            return(add);
        }
Пример #5
0
        private void ResetAll()
        {
            this.skinTextBox_ID.Text           = string.Empty;
            this.skinTextBox_Name.Text         = string.Empty;
            this.numericUpDown_Price.Value     = 0;
            this.numericUpDownCostPrice.Value  = 0;
            this.numericTextBoxSalePrice.Value = 0;
            this.skinTextBox_Remarks.Text      = string.Empty;
            this.ColorList = new List <ListItem <string> >();

            List <PfCustomerStore> stores = new List <PfCustomerStore>();
            PfCustomerStore        store  = new PfCustomerStore();

            stores.Add(store);
            dataGridViewPagingSumCtrl.BindingDataSource(stores);
            this.BaseButton3.Text = "保存";
        }
 private void HighlightCostume(PfCustomerStore store)
 {
     if (dataGridView1.Rows != null && dataGridView1.Rows.Count > 0)
     {
         foreach (DataGridViewRow row in dataGridView1.Rows)
         {
             PfCustomerStore rowStore = row.DataBoundItem as PfCustomerStore;
             if (rowStore.PfCustomerID == store.PfCustomerID && rowStore.CostumeID == store.CostumeID && rowStore.ColorName == store.ColorName)
             {
                 row.DefaultCellStyle.ApplyStyle(new DataGridViewCellStyle()
                 {
                     BackColor = Color.LightYellow
                 });
             }
         }
     }
 }
Пример #7
0
        /// <summary>
        /// 获取指定款号库存 中指定颜色的数量
        /// </summary>
        /// <param name="store">库存实体</param>
        /// <param name="sizeType">DB中的尺码标识</param>
        /// <returns></returns>
        public static int GetStoreCountBySize(PfCustomerStore store, string sizeType)
        {
            if (store == null)
            {
                return(0);
            }
            switch (sizeType)
            {
            case CostumeSize.XS:
                return(store.XS);

            case CostumeSize.S:
                return(store.S);

            case CostumeSize.M:
                return(store.M);

            case CostumeSize.L:
                return(store.L);

            case CostumeSize.XL:
                return(store.XL);

            case CostumeSize.XL2:
                return(store.XL2);

            case CostumeSize.XL3:
                return(store.XL3);

            case CostumeSize.XL4:
                return(store.XL4);

            case CostumeSize.XL5:
                return(store.XL5);

            case CostumeSize.XL6:
                return(store.XL6);

            case CostumeSize.F:
                return(store.F);

            default:
                return(0);
            }
        }
Пример #8
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            try
            {
                switch (this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value)
                {
                case "编辑":
                    PfCustomerStore store = this.dataGridView1.Rows[e.RowIndex].DataBoundItem as PfCustomerStore;

                    WholesaleBeginningSaveCostumeForm form = new WholesaleBeginningSaveCostumeForm(store);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        this.BaseButton_Search_Click(null, null);
                    }
                    break;

                case "删除":
                    DialogResult dialogResult = GlobalMessageBox.Show("确定删除该行数据吗?", "提示", MessageBoxButtons.OKCancel);
                    if (dialogResult != DialogResult.OK)
                    {
                        return;
                    }
                    //GlobalCache.ServerProxy.HideCreatePfStore()
                    this.curInboundDetailList.RemoveAt(e.RowIndex);
                    this.BindingInboundDetailSource();
                    break;
                }
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
        }
Пример #9
0
 private bool CheckDuplicate(PfCustomerStore detail)
 {
     //判断是否存在相同款号颜色,如果有则提示是否累加,确定就累加原来的,否的话则取消
     if (curInboundDetailList.Exists(t => t.PfCustomerID == detail.PfCustomerID && t.CostumeID == detail.CostumeID && t.ColorName == detail.ColorName))
     {
         int             index       = curInboundDetailList.FindIndex(t => t.PfCustomerID == detail.PfCustomerID && t.CostumeID == detail.CostumeID && t.ColorName == detail.ColorName);
         PfCustomerStore existDetail = null;
         if (index >= 0)
         {
             existDetail = curInboundDetailList[index];
             dataGridViewPagingSumCtrl.ScrollToRowIndex(index);
             GlobalMessageBox.Show("该款号颜色已存在,第" + (index + 1) + "行,请直接修改");
             return(true);
         }
     }
     else
     {
         curInboundDetailList.Add(detail);
     }
     return(false);
 }
Пример #10
0
        private void BaseButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                item = GetEntity();

                if (!Validate(item))
                {
                    return;
                }
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                if (this.CurItem != null)
                {
                    //线上商城原属性不替换
                    item.EmShowOnline  = CurItem.EmShowOnline;
                    item.EmOnlinePrice = CurItem.EmOnlinePrice;
                    item.EmTitle       = CurItem.EmTitle;
                    item.EmThumbnail   = CurItem.EmThumbnail == null ? string.Empty : CurItem.EmThumbnail;
                    item.CreateTime    = CurItem.CreateTime;
                    item.SizeNames     = CurItem.SizeNames;


                    CostumeColor  color     = this.colorComboBox1.SelectedItem;
                    List <string> colorList = CurItem.ColorList;
                    if (colorList != null)
                    {
                        if (curStore.ColorName != color.Name)
                        {
                            colorList.Remove(curStore.ColorName);
                            colorList.Add(color.Name);
                        }
                    }

                    item.Colors = CommonGlobalUtil.GetColorFromGridView(colorList);



                    short F = 0, XS = 0, S = 0, M = 0, L = 0, XL = 0, XL2 = 0, XL3 = 0, XL4 = 0, XL5 = 0, XL6 = 0;

                    if (this.dataGridView2 != null && this.dataGridView2.Rows.Count > 0)
                    {
                        PfCustomerStore curStoreItem = this.dataGridView2.Rows[0].DataBoundItem as PfCustomerStore;
                        if (curStoreItem != null)
                        {
                            F          = curStoreItem.F;
                            XS         = curStoreItem.XS;
                            S          = curStoreItem.S;
                            M          = curStoreItem.M;
                            L          = curStoreItem.L;
                            XL         = curStoreItem.XL;
                            XL2        = curStoreItem.XL2;
                            XL3        = curStoreItem.XL3;
                            XL4        = curStoreItem.XL4;
                            XL5        = curStoreItem.XL5;
                            XL6        = curStoreItem.XL6;
                            customerID = curStoreItem.PfCustomerID;
                        }
                    }
                    UpdateStartStoreCostumePara updateStorePara = new UpdateStartStoreCostumePara()
                    {
                        BrandID       = item.BrandID,
                        ClassID       = item.ClassID,
                        CostPrice     = item.CostPrice,
                        ID            = item.ID,
                        Name          = item.Name,
                        Price         = item.Price,
                        Remarks       = item.Remarks,
                        SalePrice     = item.SalePrice,
                        Season        = item.Season,
                        SizeGroupName = item.SizeGroupName,
                        SizeNames     = item.SizeNames,
                        SupplierID    = item.SupplierID,
                        Year          = item.Year,
                        OldColorName  = curStore.ColorName,
                        NewColorName  = color.Name,

                        F   = F,
                        XS  = XS,
                        S   = S,
                        L   = L,
                        M   = M,
                        XL  = XL,
                        XL2 = XL2,
                        XL3 = XL3,
                        XL4 = XL4,
                        XL5 = XL5,
                        XL6 = XL6,

                        //ShopID = curStore.PfCustomerID,
                        IsPf         = true,
                        PfCustomerID = this.customerID,
                        // PfCustomerID=
                        Colors = item.Colors,
                    };
                    InteractResult result = GlobalCache.ServerProxy.UpdateStartStoreCostume(updateStorePara);
                    // InteractResult result = GlobalCache.ServerProxy.UpdateCostume(item);
                    switch (result.ExeResult)
                    {
                    case ExeResult.Success:
                        GlobalMessageBox.Show("保存成功!");
                        // GlobalCache.CostumeList_OnChange(item);
                        CurItem = item;
                        this.Hide();
                        this.Close();
                        this.DialogResult = DialogResult.OK;
                        break;

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

                    default:
                        break;
                    }
                }
                else
                {
                    PfCustomerStore costumeStore = dataGridView2.Rows[0].DataBoundItem as PfCustomerStore;
                    PfCustomerStore item         = new PfCustomerStore();
                    ReflectionHelper.CopyProperty(costumeStore, item);
                    item.CostumeID   = skinTextBox_ID.Text;
                    item.CostumeName = skinTextBox_Name.Text;
                    item.Year        = (int)(this.skinComboBox_Year.SelectedValue);
                    item.Price       = numericUpDown_Price.Value;
                    // item.SalePrice =
                    item.CostPrice = numericUpDownCostPrice.Value;
                    item.ClassID   = skinComboBoxBigClass.SelectedValue.ClassID;
                    item.ClassCode = GetClassCode(item.ClassID);

                    //线上商城原属性不替换
                    //  item.BigClass = this.skinComboBoxBigClass.SelectedValue?.BigClass;
                    //  item.SmallClass = this.skinComboBoxBigClass.SelectedValue?.SmallClass;
                    //  item.SubSmallClass = this.skinComboBoxBigClass.SelectedValue?.SubSmallClass;
                    if (this.skinComboBox_Brand.SelectedItem != null)
                    {
                        item.BrandID   = this.skinComboBox_Brand.SelectedItem.AutoID;
                        item.BrandName = this.skinComboBox_Brand.SelectedItem.Name;
                    }
                    item.Season         = ValidateUtil.CheckEmptyValue(this.skinComboBox_Season.SelectedValue);
                    item.SupplierID     = skinComboBox_SupplierID.SelectedItem?.ID;
                    item.SupplierName   = skinComboBox_SupplierID.SelectedItem?.Name;
                    item.ColorName      = this.colorComboBox1.SelectedItem?.Name;
                    item.CostumeColorID = this.colorComboBox1.SelectedItem.ID;
                    // item.CostumeColorName = this.colorComboBox1.SelectedItem?.Name;
                    List <CostumeStoreExcel> costumeStoreExcels = new List <CostumeStoreExcel>();
                    //item.SizeGroupName= selectSizeGroup.SelectedSizeNames
                    if (selectSizeGroup != null && selectSizeGroup.SizeGroup != null)
                    {
                        item.SizeGroupName     = selectSizeGroup.SizeGroup.SizeGroupName;
                        item.SizeGroupShowName = selectSizeGroup.SizeGroup.ShowName;

                        //   item.SizeNames = selectSizeGroup.SelectedSizeNames;
                    }
                    PfCustomer pfCustomer = PfCustomerCache.GetPfCustomer(customerID);
                    item.SalePrice = this.numericTextBoxSalePrice.Value;
                    CostumeStoreExcel curCostumeStoreExcel = GetCostumeStoreExcel(item);
                    curCostumeStoreExcel.CostumeColorName = item.ColorName;
                    curCostumeStoreExcel.PfPrice          = pfCustomer.PfDiscount * item.Price / 100;

                    costumeStoreExcels.Add(curCostumeStoreExcel);


                    CreatePfCostumeStore store = new CreatePfCostumeStore()
                    {
                        PfCustomerID = customerID,

                        // Date = new CJBasic.Date(),
                        CostumeStoreExcels = costumeStoreExcels,

                        IsImport = true
                    };

                    InteractResult result = GlobalCache.ServerProxy.InsertPfCostumeStores(store);
                    switch (result.ExeResult)
                    {
                    case ExeResult.Success:
                        GlobalMessageBox.Show("新增成功!");
                        ResetAll();
                        this.Close();
                        SaveClick?.Invoke(item);
                        break;

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

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
        private object GetEntity()
        {
            PfCustomerStore item = new PfCustomerStore();

            return(item);
        }
        private void BaseButtonSaveAccount_Click(object sender, EventArgs e)
        {
            try
            {
                if (pfCustomer == null)
                {
                    GlobalMessageBox.Show("款号不能为空!");
                    skinTextBoxID.Focus();
                    return;
                }
                else
                if (String.IsNullOrEmpty(skinTextBoxID.Text))
                {
                    GlobalMessageBox.Show("款号不能为空!");
                    skinTextBoxID.Focus();
                    return;
                }
                else
                if (skinTextBoxID.Text.Contains("#"))
                {
                    GlobalMessageBox.Show("款号不能使用“#”!");
                    skinTextBoxID.Focus();
                    return;
                }
                else
                if (String.IsNullOrEmpty(skinTextBox_Name.Text))
                {
                    GlobalMessageBox.Show("商品名称不能为空!");
                    skinTextBox_Name.Focus();
                    return;
                }

                CostumeColor color = colorComboBox1.SelectedItem as CostumeColor;
                if (String.IsNullOrEmpty(color?.Name))
                {
                    GlobalMessageBox.Show("颜色不能为空!");
                    colorComboBox1.Focus();
                    return;
                }

                PfCustomerStore detail = addValue[0];
                detail.ColorName      = ValidateUtil.CheckEmptyValue(color?.Name);
                detail.CostumeID      = skinTextBoxID.Text;
                detail.CostumeName    = skinTextBox_Name.Text;
                detail.PfCustomerID   = pfCustomer.ID;
                detail.PfCustomerName = pfCustomer.Name;
                detail.PfPrice        = this.textBoxAmount.Value;
                //Shop shop = (Shop)skinComboBoxShopID.SelectedItem;
                //detail.ShopID = shop.ID;
                //detail.ShopName = shop.Name;

                //判断是否存在相同款号颜色,如果有则提示是否累加,确定就累加原来的,否的话则取消
                if (curInboundDetailList.Exists(t => t.PfCustomerID == detail.PfCustomerID && t.CostumeID == detail.CostumeID && t.ColorName == detail.ColorName))
                {
                    PfCustomerStore existDetail = curInboundDetailList.Find(t => t.PfCustomerID == detail.PfCustomerID && t.CostumeID == detail.CostumeID && t.ColorName == detail.ColorName);
                    dataGridViewPagingSumCtrl.ScrollToRowIndex(curInboundDetailList.IndexOf(existDetail));
                    if (GlobalMessageBox.Show("库存信息已存在,是否进行累加?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                    {
                        return;
                    }

                    existDetail.XS     += detail.XS;
                    existDetail.S      += detail.S;
                    existDetail.M      += detail.M;
                    existDetail.L      += detail.L;
                    existDetail.XL     += detail.XL;
                    existDetail.XL2    += detail.XL2;
                    existDetail.XL3    += detail.XL3;
                    existDetail.XL4    += detail.XL4;
                    existDetail.XL5    += detail.XL5;
                    existDetail.XL6    += detail.XL6;
                    existDetail.F      += detail.F;
                    existDetail.PfPrice = detail.PfPrice;
                }
                else
                {
                    curInboundDetailList.Add(detail);
                }

                ResetAll();
                this.BindingInboundDetailSource();
                HighlightCostume(detail);
            }
            catch (Exception ee)
            {
                GlobalUtil.ShowError(ee);
            }
        }
Пример #13
0
 private void EarlyStageCostumeStoreRecordSaveCostumeForm_SaveClick(PfCustomerStore obj)
 {
     BaseButton_Search_Click(null, null);
 }
Пример #14
0
        private void DoImport()
        {
            try
            {
                List <PfCustomerStore> unableStore  = new List <PfCustomerStore>();
                List <PfCustomerStore> stores       = new List <PfCustomerStore>();
                List <PfCustomerStore> repeatStores = new List <PfCustomerStore>();
                DataTable dt = NPOIHelper.FormatToDatatable(importPath, 0);
                for (int i = 1; i < dt.Rows.Count; i++)
                {
                    DataRow         row   = dt.Rows[i];
                    int             index = 0;
                    PfCustomerStore store = new PfCustomerStore();
                    try
                    {
                        if (!ImportValidate(row))
                        {
                            //款号	商品名称	色号	颜色名称	吊牌价	成本价	品牌	供应商名称	年份	季节	大类	小类	款型	风格	XS	S	M	L	XL	2XL	3XL	4XL	5XL	6XL	F
                            store.AutoID         = i + 2;
                            store.CostumeID      = CommonGlobalUtil.ConvertToString(row[index]);
                            store.CostumeID      = CommonGlobalUtil.ConvertToString(row[index++]);
                            store.CostumeName    = CommonGlobalUtil.ConvertToString(row[index++]);
                            store.CostumeColorID = CommonGlobalUtil.ConvertToString(row[index++]);
                            store.ColorName      = CommonGlobalUtil.ConvertToString(row[index++]);
                            //store.Price = CommonGlobalUtil.ConvertToString(row[index++]);
                            store.Price   = CommonGlobalUtil.ConvertToDecimal(row[index++]);
                            store.PfPrice = CommonGlobalUtil.ConvertToDecimal(row[index++]);

                            //store.SalePrice = CommonGlobalUtil.ConvertToDecimal(row[index++]);
                            //store.EmOnlinePrice = CommonGlobalUtil.ConvertToDecimal(row[index++]);
                            //store.PfOnlinePrice = CommonGlobalUtil.ConvertToDecimal(row[index++]);
                            store.BrandName    = CommonGlobalUtil.ConvertToString(row[index++]);
                            store.SupplierName = CommonGlobalUtil.ConvertToString(row[index++]);
                            store.Year         = CommonGlobalUtil.ConvertToInt32(row[index++]);
                            store.Season       = CommonGlobalUtil.ConvertToString(row[index++]);
                            // store.ClassCode = CommonGlobalUtil.ConvertToString(row[index++]);
                            store.BigClass      = CommonGlobalUtil.ConvertToString(row[index++]);
                            store.SmallClass    = CommonGlobalUtil.ConvertToString(row[index++]);
                            store.SubSmallClass = CommonGlobalUtil.ConvertToString(row[index++]);
                            // store.Style = CommonGlobalUtil.ConvertToString(row[index++]);
                            //  store.Models = CommonGlobalUtil.ConvertToString(row[index++]);
                            store.SizeGroupShowName = CommonGlobalUtil.ConvertToString(row[index++]);
                            store.XS  = CommonGlobalUtil.ConvertToInt16(row[index++]);
                            store.S   = CommonGlobalUtil.ConvertToInt16(row[index++]);
                            store.M   = CommonGlobalUtil.ConvertToInt16(row[index++]);
                            store.L   = CommonGlobalUtil.ConvertToInt16(row[index++]);
                            store.XL  = CommonGlobalUtil.ConvertToInt16(row[index++]);
                            store.XL2 = CommonGlobalUtil.ConvertToInt16(row[index++]);
                            store.XL3 = CommonGlobalUtil.ConvertToInt16(row[index++]);
                            store.XL4 = CommonGlobalUtil.ConvertToInt16(row[index++]);
                            store.XL5 = CommonGlobalUtil.ConvertToInt16(row[index++]);
                            store.XL6 = CommonGlobalUtil.ConvertToInt16(row[index++]);
                            store.F   = CommonGlobalUtil.ConvertToInt16(row[index++]);

                            store.PfCustomerID = pfCustomeId;
                            if ((String.IsNullOrEmpty(store.CostumeID) || String.IsNullOrEmpty(store.CostumeName) ||
                                 String.IsNullOrEmpty(store.ColorName) ||
                                 String.IsNullOrEmpty(store.SizeGroupShowName)))
                            {
                                unableStore.Add(store);
                            }
                            else
                            {
                                if (stores.Find(t => t.CostumeID == store.CostumeID && t.CostumeName == store.CostumeName &&
                                                t.ColorName == store.ColorName
                                                ) != null)
                                {
                                    repeatStores.Add(store);
                                }
                                else
                                {
                                    //store.CostumeID = CommonGlobalCache.GetCorrectCostumeID(store.CostumeID);

                                    /* if (!String.IsNullOrEmpty(store.ClassCode))
                                     * {
                                     *    store.ClassName = CommonGlobalCache.ServerProxy.GetCostumeClass4Code(store.ClassCode)?.ClassName;
                                     * }*/
                                    stores.Add(store);
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }

                if (unableStore.Count > 0)
                {
                    String str = string.Empty;
                    foreach (var item in unableStore)
                    {
                        str += "第" + item.AutoID + "行\r\n";
                    }

                    ShowError("必填项没有填写,请补充完整!\r\n" + str);
                    ImportFormCancel();
                    return;
                }
                if (repeatStores.Count > 0)
                {
                    String str = string.Empty;
                    foreach (var item in repeatStores)
                    {
                        str += "第" + item.AutoID + "行\r\n";
                    }

                    //这个与已导入的列表数据无关
                    ShowError("重复的款号与颜色,系统已过滤,详见错误报告!\r\n" + str);
                    ImportFormCancel();
                    return;
                }
                if (stores != null && stores.Count > 0)
                {
                }
                else
                {
                    ShowMessage("没有数据可以导入,请检查列表信息!");
                    ImportFormCancel();
                    return;
                }

                importPath = null;
                AddItems4Display(stores);
                //    ShowMessage("导入成功!");
                ImportFormDialogResult(DialogResult.OK);
            }
            catch (Exception ex)
            {
                ImportFormCancel();
                ShowError(ex);
            }
            finally
            {
                UnLockPage();
            }
        }
Пример #15
0
        public static List <CostumeStoreInfo> SetSizeName4CostumeStore(List <string> costumeSizes, PfCustomerStore pfCustomerStore, SizeGroup sizeGroup)
        {
            if (costumeSizes == null || costumeSizes.Count == 0)
            {
                return(new List <CostumeStoreInfo>());
            }
            List <CostumeStoreInfo> infos = new List <CostumeStoreInfo>();

            foreach (string sizeColumn in costumeSizes)
            {
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            return(infos);
        }
Пример #16
0
        public static List <CostumeStoreInfo> GetCostumeStoreInfos(PfCustomerStore pfCustomerStore, SizeGroup sizeGroup)
        {
            List <CostumeStoreInfo> infos = new List <CostumeStoreInfo>();

            if (pfCustomerStore.XS != 0)
            {
                string sizeColumn = CostumeSize.XS;
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            if (pfCustomerStore.S != 0)
            {
                string sizeColumn = CostumeSize.S;
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            if (pfCustomerStore.M != 0)
            {
                string sizeColumn = CostumeSize.M;
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            if (pfCustomerStore.L != 0)
            {
                string sizeColumn = CostumeSize.L;
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            if (pfCustomerStore.XL != 0)
            {
                string sizeColumn = CostumeSize.XL;
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            if (pfCustomerStore.XL2 != 0)
            {
                string sizeColumn = CostumeSize.XL2;
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            if (pfCustomerStore.XL3 != 0)
            {
                string sizeColumn = CostumeSize.XL3;
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            if (pfCustomerStore.XL4 != 0)
            {
                string sizeColumn = CostumeSize.XL4;
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            if (pfCustomerStore.XL5 != 0)
            {
                string sizeColumn = CostumeSize.XL5;
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            if (pfCustomerStore.XL6 != 0)
            {
                string sizeColumn = CostumeSize.XL6;
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            if (pfCustomerStore.F != 0)
            {
                string sizeColumn = CostumeSize.F;
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(pfCustomerStore, sizeColumn)
                });
            }
            return(infos);
        }