Exemplo n.º 1
0
        //private bool hasDuplicate = false;
        //private void PartNumberTextbox_TextChanged(object sender, EventArgs e)
        //{
        //    if (!string.IsNullOrWhiteSpace(PartNumberTextbox.Text))
        //        hasDuplicate = DuplicateChecker.CodeHasDuplicate(CodeType.Item, PartNumberTextbox.Text.Trim(), AutoPartId);

        //    if (hasDuplicate)
        //        PartNumberTextbox.StateCommon.Content.Color1 = Color.Red;
        //    else
        //        PartNumberTextbox.StateCommon.Content.Color1 = Color.Black;
        //}

        #endregion

        #endregion

        #region Add Brand

        private void AddBrandLink_LinkClicked(object sender, EventArgs e)
        {
            AddBrandForm form = new AddBrandForm();

            form.Owner         = this.Owner;
            form.FromAddItem   = true;
            form.BrandUpdated += new BrandUpdatedEventHandler(form_BrandUpdated);
            form.Show();
        }
Exemplo n.º 2
0
        private void OpenAddForm(int id)
        {
            selectedId = id;

            Form addForm = this.ParentForm.OwnedForms.FirstOrDefault(a => a.Name == "AddBrandForm");

            if (addForm == null)
            {
                AddBrandForm form = new AddBrandForm();
                form.BrandId       = id;
                form.Owner         = this.ParentForm;
                form.BrandUpdated += new BrandUpdatedEventHandler(form_BrandUpdated);
                form.Show();
            }
            else
            {
                AddBrandForm openedForm = (AddBrandForm)addForm;
                openedForm.BrandId = id;
                openedForm.LoadBrandDetails();
                openedForm.Focus();
            }
        }