Пример #1
0
        public override void buttonSave_Click(object sender, EventArgs e)
        {
            if (textBoxCategoryName.Text == "")
            {
                labelCategoryNameError.Visible = true;
            }
            else
            {
                labelCategoryNameError.Visible = false;
            }

            if (comboBoxIsSales.SelectedIndex == -1)
            {
                labelIsSalesError.Visible = true;
            }
            else
            {
                labelIsSalesError.Visible = false;
            }

            if (labelCategoryNameError.Visible || labelIsSalesError.Visible)
            {
                MainClass.ShowMessage("Fields with * are mandatory", "Error", "Error"); //Error is the type of message.
            }
            else
            {
                if (comboBoxIsSales.SelectedIndex == 1)
                {
                    stat = 0;
                }
                else if (comboBoxIsSales.SelectedIndex == 0)
                {
                    stat = 1;
                }
                if (edit == 0)  //Code for save operation
                {
                    Insertion insert = new Insertion();
                    insert.SaveCategoryDetails(textBoxCategoryName.Text, stat);


                    retrieve.ShowCategories(dataGridViewCat, catIdGV, CatGVName, CatGVStatus);
                    MainClass.Disable_Reset(panelRightSlider);
                }
                else if (edit == 1) //code for update operaiton
                {
                    DialogResult dr = MessageBox.Show("Are you sure, you want to update record.", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dr == DialogResult.Yes)
                    {
                        Updation update = new Updation();
                        update.UpdateCategoryDetails(textBoxCategoryName.Text, stat, CategoryId);


                        retrieve.ShowCategories(dataGridViewCat, catIdGV, CatGVName, CatGVStatus);
                        MainClass.Disable_Reset(panelRightSlider);
                    }
                }
            }
        }
 public override void buttonDelete_Click(object sender, EventArgs e)
 {
     if (edit == 1)
     {
         DialogResult dr = MessageBox.Show("Are you sure, you want to delete record.", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             Deletion del = new Deletion();
             del.DeleteDetails(ProductId, "Usp_RemoveCategoryProductDetails", "@Id");
             retrieve.ShowProducts(dataGridViewProduct, ProductIdGv, ProductNameGv, ProductCodeGv, ProductPriceGv, ProductUnitGv, ProductMinValGv, ProductCatNameGv, ProductCatIdGv, SalesPriceGv);
             MainClass.Disable_Reset(panelRightSlider);
         }
     }
 }
Пример #3
0
 public override void buttonDelete_Click(object sender, EventArgs e)
 {
     if (edit == 1)
     {
         DialogResult dr = MessageBox.Show("Are you sure, you want to delete record.", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             Deletion del = new Deletion();
             del.DeleteDetails(SupplierId, "Usp_RemoveSupplierDetails", "@SupplierId");
             retrieve.ShowSupplier(dataGridViewSupplier, SupplierIdGv, SupplierNameGv, SupplierCodeGv, SupplierContactNumberGv, SupplierEmailGv, SupplierAddresseGv, SupplierCityGv, SupplierCountryGv, SupplierPaymentMethodGv, SupplierDeliveryMethodGv, SupplierDeliveryLeadTimeIdGv);
             MainClass.Disable_Reset(panelRightSlider);
         }
     }
 }
Пример #4
0
 public override void buttonDelete_Click(object sender, EventArgs e)
 {
     if (edit == 1)
     {
         DialogResult dr = MessageBox.Show("Are you sure, you want to delete record.", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             Deletion del = new Deletion();
             del.DeleteDetails(CategoryId, "Usp_RemoveCategoryDetails", "@Id");
             retrieve.ShowCategories(dataGridViewCat, catIdGV, CatGVName, CatGVStatus);
             MainClass.Disable_Reset(panelRightSlider);
         }
     }
 }
Пример #5
0
 public override void buttonDelete_Click(object sender, EventArgs e)
 {
     if (edit == 1)
     {
         DialogResult dr = MessageBox.Show("Are you sure, you want to delete record.", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dr == DialogResult.Yes)
         {
             Deletion del = new Deletion();
             del.DeleteDetails(userId, "Usp_RemoveUserDetails", "@UserId");
             retrieve.ShowUsers(dataGridViewUsers, UserIdGV, UsernameGV, PasswordGV, ContactGv, EmailGV, Role, RoleId);
             MainClass.Disable_Reset(panelRightSlider);
         }
     }
 }
Пример #6
0
        public override void buttonSave_Click(object sender, EventArgs e)
        {
            if (textBoxSupplierName.Text == "")
            {
                labelSupplierNameError.Visible = true;
            }
            else
            {
                labelSupplierNameError.Visible = false;
            }

            if (textBoxSupplierCode.Text == "")
            {
                labelSupplierCodeError.Visible = true;
            }
            else
            {
                labelSupplierCodeError.Visible = false;
            }
            if (textBoxSupplierContactNumber.Text == "")
            {
                labelSupplierContactError.Visible = true;
            }
            else
            {
                labelSupplierContactError.Visible = false;
            }
            if (textBoxSupplierEmail.Text == "")
            {
                labelSupplierEmailError.Visible = true;
            }
            else
            {
                labelSupplierEmailError.Visible = false;
            }
            if (textBoxAddress.Text == "")
            {
                labelAddressError.Visible = true;
            }
            else
            {
                labelAddressError.Visible = false;
            }
            if (textBoxSupplierCity.Text == "")
            {
                labelSupplierCityError.Visible = true;
            }
            else
            {
                labelSupplierCityError.Visible = false;
            }

            if (textBoxCountry.Text == "")
            {
                labelCountryError.Visible = true;
            }
            else
            {
                labelCountryError.Visible = false;
            }
            if (textBoxPayment.Text == "")
            {
                labelPaymentError.Visible = true;
            }
            else
            {
                labelPaymentError.Visible = false;
            }

            if (textBoxDeliveryMethod.Text == "")
            {
                labelDelMethodError.Visible = true;
            }
            else
            {
                labelDelMethodError.Visible = false;
            }
            if (textBoxDelLeadTime.Text == "")
            {
                labelDelLeadTimeError.Visible = true;
            }
            else
            {
                labelDelLeadTimeError.Visible = false;
            }

            if (labelSupplierNameError.Visible || labelSupplierCodeError.Visible || labelSupplierContactError.Visible || labelSupplierEmailError.Visible || labelAddressError.Visible || labelSupplierCityError.Visible || labelCountryError.Visible || labelDelMethodError.Visible || labelPaymentError.Visible || labelDelLeadTimeError.Visible)
            {
                MainClass.ShowMessage("Fields with * are mandatory", "Error", "Error"); //Error is the type of message.
            }
            else
            {
                if (edit == 0)  //Code for save operation
                {
                    Insertion insert = new Insertion();
                    insert.SaveSupplierDetails(textBoxSupplierName.Text, textBoxSupplierCode.Text, textBoxSupplierContactNumber.Text, textBoxSupplierEmail.Text, textBoxAddress.Text, textBoxSupplierCity.Text, textBoxCountry.Text, textBoxPayment.Text, textBoxDeliveryMethod.Text, textBoxDelLeadTime.Text, Convert.ToDecimal(textBoxDelLeadTime.Text));


                    retrieve.ShowSupplier(dataGridViewSupplier, SupplierIdGv, SupplierNameGv, SupplierCodeGv, SupplierContactNumberGv, SupplierEmailGv, SupplierAddresseGv, SupplierCityGv, SupplierCountryGv, SupplierPaymentMethodGv, SupplierDeliveryMethodGv, SupplierDeliveryLeadTimeIdGv);
                    MainClass.Disable_Reset(panelRightSlider);
                }
                else if (edit == 1) //code for update operaiton
                {
                    DialogResult dr = MessageBox.Show("Are you sure, you want to update record.", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dr == DialogResult.Yes)
                    {
                        Updation update = new Updation();
                        update.UpdateSupplierDetails(textBoxSupplierName.Text, textBoxSupplierCode.Text, textBoxSupplierContactNumber.Text, textBoxSupplierEmail.Text, textBoxAddress.Text, textBoxSupplierCity.Text, textBoxCountry.Text, textBoxPayment.Text, textBoxDeliveryMethod.Text, textBoxDelLeadTime.Text, Convert.ToDecimal(textBoxDelLeadTime.Text), SupplierId);

                        retrieve.ShowSupplier(dataGridViewSupplier, SupplierIdGv, SupplierNameGv, SupplierCodeGv, SupplierContactNumberGv, SupplierEmailGv, SupplierAddresseGv, SupplierCityGv, SupplierCountryGv, SupplierPaymentMethodGv, SupplierDeliveryMethodGv, SupplierDeliveryLeadTimeIdGv);
                        MainClass.Disable_Reset(panelRightSlider);
                    }
                }
            }
        }
Пример #7
0
 private void Supplier_Load(object sender, EventArgs e)
 {
     MainClass.Disable_Reset(panelRightSlider);
 }
Пример #8
0
 private void Categories_Load(object sender, EventArgs e)
 {
     MainClass.Disable_Reset(panelRightSlider);
 }
Пример #9
0
        public override void buttonSave_Click(object sender, EventArgs e)
        {
            if (textBoxUserName.Text == "")
            {
                labelNameError.Visible = true;
            }
            else
            {
                labelNameError.Visible = false;
            }
            if (textBoxPasword.Text == "")
            {
                labelPasswordError.Visible = true;
            }
            else
            {
                labelPasswordError.Visible = false;
            }
            if (textBoxContact.Text == "")
            {
                labelContactNumberError.Visible = true;
            }
            else
            {
                labelContactNumberError.Visible = false;
            }
            if (textBoxEmail.Text == "")
            {
                labelEmailError.Visible = true;
            }
            else
            {
                labelEmailError.Visible = false;
            }
            if (comboBoxSelectRole.SelectedIndex == -1)
            {
                labelRoleError.Visible = true;
            }
            else
            {
                labelRoleError.Visible = false;
            }
            if (labelNameError.Visible || labelPasswordError.Visible || labelContactNumberError.Visible || labelEmailError.Visible || labelRoleError.Visible)
            {
                MainClass.ShowMessage("Fields with * are mandatory", "Error", "Error"); //Error is the type of message.
            }
            else
            {
                if (edit == 0)  //Code for save operation
                {
                    Insertion insert = new Insertion();
                    insert.SaveUserDetails(textBoxUserName.Text, textBoxPasword.Text, textBoxContact.Text, textBoxEmail.Text, Convert.ToInt32(comboBoxSelectRole.SelectedValue));

                    retrieve.ShowUsers(dataGridViewUsers, UserIdGV, UsernameGV, PasswordGV, ContactGv, EmailGV, Role, RoleId);
                    MainClass.Disable_Reset(panelRightSlider);
                }
                else if (edit == 1) //code for update operaiton
                {
                    DialogResult dr = MessageBox.Show("Are you sure, you want to update record.", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dr == DialogResult.Yes)
                    {
                        Updation update = new Updation();
                        update.UpdateUserDetails(textBoxUserName.Text, textBoxPasword.Text, textBoxContact.Text, textBoxEmail.Text, userId, Convert.ToInt32(comboBoxSelectRole.SelectedValue));

                        retrieve.ShowUsers(dataGridViewUsers, UserIdGV, UsernameGV, PasswordGV, ContactGv, EmailGV, Role, RoleId);
                        MainClass.Disable_Reset(panelRightSlider);
                    }
                }
            }
        }
Пример #10
0
 private void User_Load()
 {
     MainClass.Disable_Reset(panelRightSlider);
 }