Exemplo n.º 1
0
        private string ValidateLineControlles()
        {
            string ValidateMessage = string.Empty;

            if (DropDownItemName.SelectedIndex <= 0)
            {
                DropDownItemName.Focus();
                return("Please select the Item Name.");
            }
            if (DropDownProductName.SelectedIndex <= 0)
            {
                DropDownProductName.Focus();
                return("Please select the Product Name.");
            }
            if (DropDownBrandName.SelectedIndex <= 0)
            {
                DropDownBrandName.Focus();
                return("Please select the Brand Name.");
            }
            if (DropDownColorName.SelectedIndex <= 0)
            {
                DropDownColorName.Focus();
                return("Please select the Color");
            }
            if (string.IsNullOrEmpty(TxtNoItems.Text.ToString()))
            {
                TxtNoItems.Focus();
                return("Please enter the number of Items");
            }
            if (DropDownUnit.SelectedIndex <= 0)
            {
                DropDownUnit.Focus();
                return("Please select the Unit.");
            }
            if (string.IsNullOrEmpty(TxtPurchasePrice.Text.ToString()))
            {
                TxtPurchasePrice.Focus();
                return("Please enter the purchase price");
            }
            if (string.IsNullOrEmpty(TxtSalesPrice.Text.ToString()))
            {
                TxtSalesPrice.Focus();
                return("Please enter the sales price");
            }
            if (string.IsNullOrEmpty(TxtCgstPer.Text.ToString()))
            {
                TxtCgstPer.Focus();
                return("Please enter the Cgst percentage");
            }
            if (string.IsNullOrEmpty(TxtSgstPer.Text.ToString()))
            {
                TxtSgstPer.Focus();
                return("Please enter the Sgst percentage");
            }
            return(ValidateMessage);
        }
Exemplo n.º 2
0
 private void BtnInsertUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (DropDownItemName.SelectedIndex <= 0)
         {
             messageShow.singlemsgtext("Please select the Item Name.");
             DropDownItemName.Focus();
             return;
         }
         if (DropDownProductName.SelectedIndex <= 0)
         {
             messageShow.singlemsgtext("Please select the Product Name.");
             DropDownProductName.Focus();
             return;
         }
         if (string.IsNullOrEmpty(TxtBrandName.Text.ToString()))
         {
             messageShow.singlemsgtext("Brand name should not be empty");
             TxtBrandName.Focus();
             return;
         }
         SelectedProductCode = Convert.ToInt32(((KeyValuePair <string, string>)DropDownProductName.SelectedItem).Key.ToString());
         var brand_master = new BrandMaster
         {
             BrandName     = TxtBrandName.Text.ToString(),
             ProductCode   = SelectedProductCode,
             BrandCode     = BrandCode,
             OperationType = BtnInsertUpdate.Text.ToString() == "Save" ? 1 : 2
         };
         int id = _instanceRepository.InsertUpdateDeleteBrandMaster(brand_master);
         if (id >= 1)
         {
             messageShow.singlemsgtext(brand_master.OperationType == 1 ? "New Brand added successfully" : "Brand updated successfully");
             brand_master.BrandName = "";
             ResetAllControls();
         }
         else if (id == -1)
         {
             messageShow.singlemsgtext("The brand name already exists, please try another name!");
         }
         else
         {
             messageShow.singlemsgtext("Error in Brand insert/update");
         }
     }
     catch (Exception _exception)
     {
         CmC.InsertException(_exception);
         messageShow.singlemsgtext(CmC.ExceptionErrorMessage);
     }
 }
Exemplo n.º 3
0
        private string ValidateLineControlles()
        {
            string ValidateMessage = string.Empty;

            if (DropDownItemName.SelectedIndex <= 0)
            {
                DropDownItemName.Focus();
                return("Please select the Item Name.");
            }
            if (DropDownProductName.SelectedIndex <= 0)
            {
                DropDownProductName.Focus();
                return("Please select the Product Name.");
            }
            if (DropDownBrandName.SelectedIndex <= 0)
            {
                DropDownBrandName.Focus();
                return("Please select the Brand Name.");
            }
            if (DropDownColorName.SelectedIndex <= 0)
            {
                DropDownColorName.Focus();
                return("Please select the Color");
            }
            if (string.IsNullOrEmpty(TxtNoOfItems.Text.ToString()))
            {
                TxtNoOfItems.Focus();
                return("Please enter the number of Items");
            }
            if (string.IsNullOrEmpty(TxtDiscountHeader.Text.ToString()))
            {
                TxtDiscountHeader.Focus();
                return("Please enter the discount price");
            }
            return(ValidateMessage);
        }