コード例 #1
0
        private void baseButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (GlobalMessageBox.Show("确定保存该客户的期初库存吗?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                bool flagIsRepeat;
                CreatePfCostumeStore store = new CreatePfCostumeStore()
                {
                    PfCustomerID = PfCustomeID,
                    //Date = new Date( dateTimePicker_Start.Value),
                    CostumeStoreExcels = GetCostumeStoreExcels(out flagIsRepeat),
                    IsImport           = isFilter
                };
                if (flagIsRepeat)
                {
                    GlobalMessageBox.Show("存在重复颜色的款号,请确认后再保存!");
                    return;
                }
                //补全属性
                InteractResult result = GlobalCache.ServerProxy.InsertPfCostumeStores(store);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    GlobalMessageBox.Show("保存成功!");
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ex) { GlobalUtil.ShowError(ex); }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
コード例 #2
0
        private void baseButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (GlobalMessageBox.Show("确定保存该店铺的期初库存吗?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                CreatePfCostumeStore store = new CreatePfCostumeStore()
                {
                    PfCustomerID = pfCustomeId,
                    //  Date = new Date(dateTimePicker_Start.Value),
                    CostumeStoreExcels = GetCostumeStoreExcels(),
                    IsImport           = true
                };

                InteractResult result = GlobalCache.ServerProxy.InsertPfCostumeStores(store);

                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    GlobalMessageBox.Show("保存成功!");
                    curInboundDetailList.Clear();
                    this.dataGridView1.DataSource = null;
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ex) { GlobalUtil.ShowError(ex); }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
コード例 #3
0
        private void baseButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (pfCustomer == null)
                {
                    GlobalMessageBox.Show("客户不存在,请重新选择!");
                    skinComboBox_PfCustomer.Focus();
                    return;
                }
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                CreatePfCostumeStore cPfCostumeStore = new CreatePfCostumeStore();
                InteractResult       result          = GlobalCache.ServerProxy.InsertPfCostumeStores(cPfCostumeStore);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    GlobalMessageBox.Show("保存成功!");
                    //baseButton3.Enabled = false;
                    //baseButtonEnd.Visible = false;
                    break;

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

                default:
                    break;
                }
            }
            catch (Exception ex) { GlobalUtil.ShowError(ex); }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
コード例 #4
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);
            }
        }