예제 #1
0
 /// <summary>
 /// function to fill all pricing level on the datagridview
 /// </summary>
 public void Gridfill()
 {
     try
     {
         DataTable      dtblPricingLevel = new DataTable();
         PricingLevelSP spPricingLevel   = new PricingLevelSP();
         dtblPricingLevel           = spPricingLevel.PricingLevelOnlyViewAll();
         dgvPricingLevel.DataSource = dtblPricingLevel;
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PL4" + ex.Message;
     }
 }
예제 #2
0
 /// <summary>
 /// Function to edit the Pricing level
 /// </summary>
 public void EditFunction()
 {
     try
     {
         PricingLevelSP   spPricingLevel   = new PricingLevelSP();
         PricingLevelInfo infoPricingLevel = new PricingLevelInfo();
         infoPricingLevel.PricinglevelName = txtPricingLevelName.Text.Trim();
         infoPricingLevel.Narration        = txtNarration.Text.Trim();
         infoPricingLevel.Extra1           = string.Empty;
         infoPricingLevel.Extra2           = string.Empty;
         infoPricingLevel.PricinglevelId   = Convert.ToDecimal(dgvPricingLevel.CurrentRow.Cells[1].Value.ToString());
         if (txtPricingLevelName.Text.ToString() != strPricingLevel)
         {
             if (spPricingLevel.PricingLevelCheckIfExist(txtPricingLevelName.Text.Trim().ToString(), decPricingLevel) == false)
             {
                 if (spPricingLevel.PricingLevelEditParticularFields(infoPricingLevel))
                 {
                     Messages.UpdatedMessage();
                     Clear();
                 }
                 else if (infoPricingLevel.PricinglevelId == 1)
                 {
                     Messages.InformationMessage("Cannot update");
                     Clear();
                     txtPricingLevelName.Focus();
                 }
             }
             else
             {
                 Messages.InformationMessage("Pricing level name already exist");
                 txtPricingLevelName.Focus();
             }
         }
         else
         {
             spPricingLevel.PricingLevelEditParticularFields(infoPricingLevel);
             Messages.UpdatedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PL2" + ex.Message;
     }
 }
예제 #3
0
 /// <summary>
 /// Function to execute while calling from frmPriceList form to add new pricelist for the product
 /// </summary>
 /// <param name="decPricingLevel"></param>
 /// <param name="decProduct"></param>
 /// <param name="decPriceListId"></param>
 /// <param name="frmPriceList"></param>
 public void CallFromPriceListForPricingLevel(decimal decPricingLevel, decimal decProduct, decimal decPriceListId, frmPriceList frmPriceList)
 {
     try
     {
         ProductInfo      infoProduct      = new ProductInfo();
         ProductSP        spProduct        = new ProductSP();
         UnitSP           spunit           = new UnitSP();
         UnitInfo         infoUnit         = new UnitInfo();
         PriceListSP      spPriceList      = new PriceListSP();
         PriceListInfo    infoPriceList    = new PriceListInfo();
         PricingLevelSP   spPricingLevel   = new PricingLevelSP();
         PricingLevelInfo infoPricingLevel = new PricingLevelInfo();
         infoProduct          = spProduct.PriceListPopUpView(decProduct);
         txtProductCode.Text  = infoProduct.ProductCode;
         txtProductName.Text  = infoProduct.ProductName;
         decProduct           = infoProduct.ProductId;
         decProductMain       = infoProduct.ProductId;
         infoUnit             = spunit.UnitViewForPriceListPopUp(decProduct);
         decUnitId            = infoUnit.UnitId;
         txtUnitName.Text     = infoUnit.UnitName;
         decPriceLevelId      = infoPriceList.PricinglevelId;
         infoPricingLevel     = spPricingLevel.PricingLevelNameViewForPriceListPopUp(decPricingLevel, decProduct, decUnitId);
         decPriceLevelId      = infoPricingLevel.PricinglevelId;
         txtPricingLevel.Text = infoPricingLevel.PricinglevelName;
         if (txtPricingLevel.Text == string.Empty)
         {
             infoPricingLevel     = spPricingLevel.PricingLevelView(decPricingLevel);
             txtPricingLevel.Text = infoPricingLevel.PricinglevelName;
         }
         decPricingLevelMain      = infoPricingLevel.PricinglevelId;
         txtPricingLevel.ReadOnly = true;
         txtProductCode.ReadOnly  = true;
         txtProductName.ReadOnly  = true;
         txtUnitName.ReadOnly     = true;
         txtRate.Focus();
         BatchUnderProductComboFill(decProduct);
         PriceListPopupGridFill();
         deca = decPriceListId;
         this.frmPriceListobj = frmPriceList;
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PLP1" + ex.Message + ex.Message;
     }
 }
예제 #4
0
 /// <summary>
 /// Function to fill the fields for Edit or Delete
 /// </summary>
 public void FillControls()
 {
     try
     {
         PricingLevelSP   spPricingLevel   = new PricingLevelSP();
         PricingLevelInfo infoPricingLevel = new PricingLevelInfo();
         infoPricingLevel         = spPricingLevel.PricingLevelWithNarrationView(Convert.ToDecimal(dgvPricingLevel.CurrentRow.Cells[1].Value.ToString()));
         txtPricingLevelName.Text = infoPricingLevel.PricinglevelName;
         txtNarration.Text        = infoPricingLevel.Narration;
         btnSave.Text             = "Update";
         btnDelete.Enabled        = true;
         decPricingLevel          = infoPricingLevel.PricinglevelId;
         strPricingLevel          = infoPricingLevel.PricinglevelName;
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PL8" + ex.Message;
     }
 }
예제 #5
0
 /// <summary>
 /// Function to delete selected pricing level
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         PricingLevelSP spPricingLevel = new PricingLevelSP();
         if (spPricingLevel.PricingLevelCheckReferenceAndDelete(decPricingLevel) <= 0)
         {
             Messages.ReferenceExistsMessage();
         }
         else
         {
             spPricingLevel.PricingLevelDelete(Convert.ToDecimal(dgvPricingLevel.CurrentRow.Cells[1].Value.ToString()));
             Messages.DeletedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PL6" + ex.Message;
     }
 }
예제 #6
0
 /// <summary>
 /// Function to save the Pricinglevel
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         PricingLevelSP   spPricingLevel   = new PricingLevelSP();
         PricingLevelInfo infoPricingLevel = new PricingLevelInfo();
         infoPricingLevel.PricinglevelName = txtPricingLevelName.Text.Trim();
         infoPricingLevel.Narration        = txtNarration.Text.Trim();
         infoPricingLevel.Extra1           = string.Empty;
         infoPricingLevel.Extra2           = string.Empty;
         if (spPricingLevel.PricingLevelCheckIfExist(txtPricingLevelName.Text.Trim().ToString(), 0) == false)
         {
             decPricingLevelId = spPricingLevel.PricingLevelAddWithoutSamePricingLevel(infoPricingLevel);
             Messages.SavedMessage();
             Clear();
             decIdforOtherForms = decPricingLevelId;
             if (frmCustomerObj != null)
             {
                 this.Close();
             }
             if (frmSalesReturnObj != null)
             {
                 this.Close();
             }
             if (frmSalesInvoiceObj != null)
             {
                 this.Close();
             }
         }
         else
         {
             Messages.InformationMessage("Pricing level name already exist");
             txtPricingLevelName.Focus();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PL1" + ex.Message;
     }
 }
예제 #7
0
 /// <summary>
 /// Function to fill the fields while user double click on the datagridview
 /// </summary>
 public void FillControls()
 {
     try
     {
         PriceListInfo infoPricelist = new PriceListInfo();
         PriceListSP   spPricelist   = new PriceListSP();
         infoPricelist.PricelistId = decpriceListId;
         infoPricelist             = spPricelist.PriceListView(decpriceListId);
         txtRate.Text = infoPricelist.Rate.ToString();
         ProductInfo infoProduct = new ProductInfo();
         ProductSP   spProduct   = new ProductSP();
         infoProduct         = spProduct.PriceListPopUpView(decProductId);
         txtProductCode.Text = infoProduct.ProductCode;
         txtProductName.Text = infoProduct.ProductName;
         BatchInfo infobatch = new BatchInfo();
         BatchSP   spBatch   = new BatchSP();
         infobatch = spBatch.BatchView(decBatchId);
         cmbBatch.SelectedValue = infobatch.BatchId;
         UnitInfo infoUnit = new UnitInfo();
         UnitSP   spUnit   = new UnitSP();
         infoUnit         = spUnit.UnitView(decUnitId);
         txtUnitName.Text = infoUnit.UnitName;
         PricingLevelInfo infoPricingLevel = new PricingLevelInfo();
         PricingLevelSP   spPricingLevel   = new PricingLevelSP();
         infoPricingLevel         = spPricingLevel.PricingLevelView(decPriceLevelId);
         txtPricingLevel.Text     = infoPricingLevel.PricinglevelName;
         txtProductName.ReadOnly  = true;
         txtProductCode.ReadOnly  = true;
         txtUnitName.ReadOnly     = true;
         txtPricingLevel.ReadOnly = true;
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PLP10" + ex.Message + ex.Message;
     }
 }