Ejemplo n.º 1
0
        public SizeGroupSelectForm(SizeGroupSetting selectSizeGroup, String costumeID)
        {
            InitializeComponent();
            SetSize();

            if (selectSizeGroup != null && selectSizeGroup.SizeGroup != null)
            {
                skinComboBoxSizeGroup.SelectedItem = selectSizeGroup.SizeGroup;
            }

            this.costumeID = costumeID;
            this.result    = selectSizeGroup;
        }
Ejemplo n.º 2
0
        private void baseButtonSelectSizeGroup_Click(object sender, EventArgs e)
        {
            SizeGroupSelectForm size = new SizeGroupSelectForm(selectSizeGroup, skinTextBox_ID.Text);

            size.ShowDialog(this);
            if (size.DialogResult == DialogResult.OK)
            {
                selectSizeGroup         = size.Result;
                skinLabelSizeGroup.Text = selectSizeGroup.SelectedDisplaySizeNames;

                SetDataGridData();

                /*   if (selectSizeGroup.Items.Count > 0)
                 * {
                 *     List<string> disNames = selectSizeGroup.DisplayItems;
                 *     List<string> Names = selectSizeGroup.Items;
                 *     List<CostumeStore> stores = new List<CostumeStore>();
                 *     CostumeStore costumeStore = new CostumeStore();
                 *     //  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
                 * }*/
            }

            /*  addValue.Clear();
             * addValue.Add(new CostumeStore());
             * dataGridView2.DataSource = null;
             * dataGridView2.DataSource = addValue;*/
        }
Ejemplo n.º 3
0
        private void baseButton2_Click(object sender, EventArgs e)
        {
            SizeGroupSelectForm size = new SizeGroupSelectForm(selectSizeGroup, string.Empty);

            size.ShowDialog(this);
            if (size.DialogResult == DialogResult.OK)
            {
                selectSizeGroup = size.Result;
                if (String.IsNullOrEmpty(selectSizeGroup.SelectedDisplaySizeNames))
                {
                }
                else
                {
                    skinLabelSizeGroup.Text = selectSizeGroup.SelectedDisplaySizeNames;
                }
            }
        }
Ejemplo n.º 4
0
 private void LoadConfig()
 {
     try
     {
         try
         {
             config = SaveCostumeFormConfiguration.Load(CONFIG_PATH) as SaveCostumeFormConfiguration;
         }
         catch (Exception ex)
         {
             GlobalUtil.WriteLog(ex);
         }
         if (config == null)
         {
             config = new SaveCostumeFormConfiguration();
         }
         else
         {
             if (config.Costume != null)
             {
                 //  skinComboBox_SupplierID.SelectedValue = config.Costume.SupplierID;
                 skinComboBox_Brand.SelectedValue = config.Costume.BrandID;
                 skinComboBox_Year.SelectedValue  = config.Costume.Year.ToString();
                 skinComboBox_Season.skinComboBox.SelectedValue = config.Costume.Season;
                 skinComboBoxBigClass.SelectedValue             = config.Costume;
                 //加载上次保存的尺码组信息
                 selectSizeGroup                   = new SizeGroupSetting();
                 selectSizeGroup.SizeGroup         = CommonGlobalCache.GetSizeGroup(config.Costume.SizeGroupName);
                 selectSizeGroup.SelectedSizeNames = config.Costume.SizeNames;
                 skinLabelSizeGroup.Text           = selectSizeGroup.SelectedDisplaySizeNames;
                 //  skinCmbProperty.SelectedValue = (CostumeProperty)config.Costume.Property;
             }
         }
     }
     catch (Exception ex)
     {
         GlobalUtil.ShowError(ex);
     }
 }
Ejemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.result = new SizeGroupSetting()
            {
                SizeGroup = this.skinComboBoxSizeGroup.SelectedItem as SizeGroup,
                Items     = GetCheckBoxTags()
            };


            if (result.Items == null || result.Items.Count == 0)
            {
                GlobalMessageBox.Show("请至少选择一个尺码!");
                return;
            }

            if (!String.IsNullOrEmpty(costumeID))
            {
                InteractResult interactResult = GlobalCache.ServerProxy.CheckCostumeSize(this.costumeID, result.SizeGroup.SizeGroupName, GetUnCheckBoxTags());
                switch (interactResult.ExeResult)
                {
                case ExeResult.Success:
                    this.DialogResult = DialogResult.OK;
                    break;

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

                default:
                    break;
                }
            }
            else
            {
                this.DialogResult = DialogResult.OK;
            }
        }
Ejemplo n.º 6
0
        private void CostumeCurrentShopTextBox1_CostumeSelected(Costume costumeItem, bool isEnter)
        {
            if (isEnter)
            {
                if (costumeItem != null)
                {
                    this.skinTextBox_Name.Text = costumeItem.Name;
                    if (costumeItem.Name != "")
                    {
                        this.skinTextBox_Name.Enabled = false;
                    }
                    this.numericUpDown_Price.Value = costumeItem.Price;
                    //if (costumeItem.Price > 0)
                    //{
                    this.numericUpDown_Price.Enabled = false;
                    //}
                    this.skinComboBox_Season.skinComboBox.SelectedValue = costumeItem.Season;
                    if (costumeItem.Season != "")
                    {
                        this.skinComboBox_Season.Enabled = false;
                    }
                    this.skinComboBox_Year.SelectedValue = costumeItem.Year;
                    if (costumeItem.Year > 0)
                    {
                        this.skinComboBox_Year.Enabled = false;
                    }
                    this.skinComboBoxBigClass.SelectedValue = costumeItem;
                    if (costumeItem.BigClassID > 0)
                    {
                        this.skinComboBoxBigClass.Enabled = false;
                    }
                    this.skinComboBox_Brand.SelectedValue = costumeItem.BrandID;
                    if (costumeItem.BrandID > 0)
                    {
                        this.skinComboBox_Brand.Enabled = false;
                    }
                    this.skinComboBox_SupplierID.SelectedValue = costumeItem.SupplierID;
                    if (costumeItem.SupplierID != "")
                    {
                        this.skinComboBox_SupplierID.Enabled = false;
                    }
                    this.colorComboBox1.SelectedValue = CommonGlobalCache.GetColorIDByName(costumeItem.Colors.Split(',')[0]);

                    this.numericUpDownCostPrice.Value = costumeItem.CostPrice;

                    //if (costumeItem.CostPrice > 0)
                    //{
                    this.numericUpDownCostPrice.Enabled = false;
                    //}
                    numericTextBoxSalePrice.Value = costumeItem.SalePrice;
                    //if (costumeItem.SalePrice >= 0)
                    //{
                    this.numericTextBoxSalePrice.Enabled = false;
                    //}
                    selectSizeGroup = new SizeGroupSetting();
                    if (costumeItem.SizeNames != "")
                    {
                        baseButtonSelectSizeGroup.Enabled = false;
                    }
                    SizeGroup sizeGroup = GlobalCache.GetSizeGroup(costumeItem?.SizeGroupName);
                    selectSizeGroup.Items     = costumeItem.SizeNameList;
                    selectSizeGroup.SizeGroup = sizeGroup;
                    //this.selectSizeGroup = selectSizeGroup;
                    SetDataGridData();
                    skinLabelSizeGroup.Text = CommonGlobalUtil.GetSizeDisplayNames(sizeGroup, costumeItem?.SizeNames);
                    if (costumeItem.Remarks != null)
                    {
                        this.skinTextBox_Remarks.Text = costumeItem.Remarks;
                    }
                }
                else
                {
                    this.skinTextBox_Name.Enabled        = true;
                    this.numericUpDown_Price.Enabled     = true;
                    this.skinComboBox_Season.Enabled     = true;
                    this.skinComboBox_Year.Enabled       = true;
                    this.skinComboBoxBigClass.Enabled    = true;
                    this.skinComboBox_Brand.Enabled      = true;
                    this.skinComboBox_SupplierID.Enabled = true;
                    this.numericUpDownCostPrice.Enabled  = true;
                    this.numericTextBoxSalePrice.Enabled = true;
                    baseButtonSelectSizeGroup.Enabled    = true;
                }
            }
        }