Example #1
0
        private void btnAddNewDesign_Click(object sender, EventArgs e)
        {
            var client = InternalClientService.GetInternalClientByID(clientID);

            if (!string.IsNullOrEmpty(txtDefaultColor.Text) && !string.IsNullOrEmpty(txtDesignNumber.Text))
            {
                var designs = client.ClientDesigns;
                if (designs == null)
                {
                    designs = new List <Models.InternalClientDesign>();
                    client.ClientDesigns = designs;
                }
                var design = designs.Where(x => x.design_number == txtDesignNumber.Text).FirstOrDefault();
                if (design == null)
                {
                    design = new Models.InternalClientDesign();
                    design.design_number = txtDesignNumber.Text;

                    design.colors = new List <string>();
                    design.colors.Add(txtDefaultColor.Text);

                    client.ClientDesigns.Add(design);
                }
                InternalClientService.UpdateInternalClient(client);
                userAdmin.Enabled = true;
                userAdmin.AdminRefresh();
                this.Close();
            }
        }
Example #2
0
        private void btnAddNewStyle_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtStyle.Text) &&
                !string.IsNullOrEmpty(txtDescription.Text) &&
                !string.IsNullOrEmpty(txtEtsyDescription.Text))
            {
                var gclient = InternalClientService.GetInternalClientByID(clientID);
                var style   = gclient.ClientStyles.Where(x => x.style_number == txtStyle.Text).FirstOrDefault();
                if (style == null)
                {
                    style = new Models.InternalClientStyle();
                    style.style_number          = txtStyle.Text;
                    style.style_description     = txtDescription.Text;
                    style.etsy_style_descripion = txtEtsyDescription.Text;

                    gclient.ClientStyles.Add(style);
                    InternalClientService.UpdateInternalClient(gclient);
                    userAdmin.Enabled = true;
                    userAdmin.AdminRefresh();
                    this.Close();
                }
            }
        }
Example #3
0
 private void AddColor_FormClosed(object sender, FormClosedEventArgs e)
 {
     userAdmin.Enabled = true;
     userAdmin.AdminRefresh();
 }