/// <summary>
 /// Function to save the new pricelist for the product
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         PriceListSP   spPriceList   = new PriceListSP();
         PriceListInfo infoPriceList = new PriceListInfo();
         infoPriceList.ProductId      = decProductMain;
         infoPriceList.PricinglevelId = decPricingLevelMain;
         infoPriceList.UnitId         = decUnitId;
         infoPriceList.BatchId        = Convert.ToDecimal(cmbBatch.SelectedValue.ToString());
         infoPriceList.Rate           = Convert.ToDecimal(txtRate.Text);
         infoPriceList.Extra1         = string.Empty;
         infoPriceList.Extra2         = string.Empty;
         if (spPriceList.PriceListCheckExistence(0, decPricingLevelMain, Convert.ToDecimal(cmbBatch.SelectedValue.ToString()), decProductMain) == true)
         {
             spPriceList.PriceListAdd(infoPriceList);
             Messages.SavedMessage();
             Clear();
         }
         else
         {
             Messages.InformationMessage("Price List already exist for selected product and batches");
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #2
0
 /// <summary>
 /// Function to fill the pricelist details in datagridview
 /// </summary>
 public void PriceListPopupGridFill()
 {
     try
     {
         DataTable   dtbl        = new DataTable();
         PriceListSP spPriceList = new PriceListSP();
         dtbl = spPriceList.PriceListPopupGridFill(decPricingLevelMain, decProductMain);
         dgvProductGroup.DataSource = dtbl;
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PLP11" + ex.Message + ex.Message;
     }
 }
Example #3
0
 /// <summary>
 /// Function to fill the pricelist details for the products
 /// </summary>
 public void GridFill()
 {
     try
     {
         DataTable   dtbl        = new DataTable();
         PriceListSP spPriceList = new PriceListSP();
         dtbl = spPriceList.PriceListGridFill();
         dgvProductGroup.DataSource = dtbl;
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PLP7" + ex.Message + ex.Message;
     }
 }
 /// <summary>
 /// Function to fill the pricelist details in datagridview
 /// </summary>
 public void PriceListPopupGridFill()
 {
     try
     {
         DataTable   dtbl        = new DataTable();
         PriceListSP spPriceList = new PriceListSP();
         dtbl = spPriceList.PriceListPopupGridFill(decPricingLevelMain, decProductMain);
         dgvProductGroup.DataSource = dtbl;
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP10" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #5
0
 /// <summary>
 /// Function to fill the pricelevel combobox
 /// </summary>
 public void PricelevelComboFill()
 {
     try
     {
         DataTable   dtbl        = new DataTable();
         PriceListSP spPriceList = new PriceListSP();
         dtbl = spPriceList.PricelistPricingLevelViewAllForComboBox();
         cmbPricingLevel.DataSource    = dtbl;
         cmbPricingLevel.ValueMember   = "pricinglevelId";
         cmbPricingLevel.DisplayMember = "pricinglevelName";
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PCL3" + ex.Message;
     }
 }
Example #6
0
 /// <summary>
 /// Function to fill the pricelevel combobox
 /// </summary>
 public void PricelevelComboFill()
 {
     try
     {
         DataTable   dtbl        = new DataTable();
         PriceListSP spPriceList = new PriceListSP();
         dtbl = spPriceList.PricelistPricingLevelViewAllForComboBox();
         cmbPricingLevel.DataSource    = dtbl;
         cmbPricingLevel.ValueMember   = "pricinglevelId";
         cmbPricingLevel.DisplayMember = "pricinglevelName";
     }
     catch (Exception ex)
     {
         MessageBox.Show("PCL3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to edit the pricelist
 /// </summary>
 public void EditFunction()
 {
     try
     {
         if (txtRate.Text.Trim() == String.Empty)
         {
             Messages.InformationMessage("Enter rate");
             txtRate.Focus();
         }
         else if (Convert.ToDecimal(txtRate.Text) == 0)
         {
             PriceListSP spPriceList = new PriceListSP();
             spPriceList.PriceListDelete(deca);
             Messages.UpdatedMessage();
             if (frmPriceListobj != null)
             {
                 this.Close();
             }
         }
         else
         {
             PriceListSP   spPriceList   = new PriceListSP();
             PriceListInfo infoPriceList = new PriceListInfo();
             infoPriceList.ProductId      = decProductMain;
             infoPriceList.PricelistId    = Convert.ToDecimal(dgvProductGroup.CurrentRow.Cells["dgvtxtPriceListId"].Value.ToString());
             infoPriceList.PricinglevelId = decPricingLevelMain;
             infoPriceList.UnitId         = decUnitId;
             infoPriceList.BatchId        = decBatchId;
             infoPriceList.Rate           = Convert.ToDecimal(txtRate.Text);
             infoPriceList.Extra1         = string.Empty;
             infoPriceList.Extra2         = string.Empty;
             spPriceList.PriceListEdit(infoPriceList);
             Messages.UpdatedMessage();
             Clear();
             if (frmPriceListobj != null)
             {
                 this.Close();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <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)
     {
         MessageBox.Show("PLP1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #9
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)
     {
         MessageBox.Show("PLP1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #10
0
 /// <summary>
 /// On print button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvPriceList.Rows.Count > 0)
         {
             frmReport frmReport = new frmReport();
             frmReport.MdiParent = formMDI.MDIObj;
             DataTable dtblOption = new DataTable();
             dtblOption.Columns.Add("PurchaseRate", typeof(String));
             dtblOption.Columns.Add("SalesRate", typeof(String));
             dtblOption.Columns.Add("LastSalesRate", typeof(String));
             dtblOption.Columns.Add("StandardRate", typeof(String));
             dtblOption.Columns.Add("MRP", typeof(String));
             dtblOption.Columns.Add("Price", typeof(String));
             DataRow dr = dtblOption.NewRow();
             dr["PurchaseRate"]  = cbxPurchaseRate.Checked?"True":"False";
             dr["SalesRate"]     = cbxSalesRate.Checked ? "True" : "False";
             dr["LastSalesRate"] = cbxlastSalesRate.Checked ? "True" : "False";
             dr["StandardRate"]  = CbxStandardRate.Checked ? "True" : "False";
             dr["MRP"]           = cbxMrp.Checked ? "True" : "False";
             dr["Price"]         = "True";
             dtblOption.Rows.Add(dr);
             DataSet     ds                    = new DataSet();
             CompanySP   spCompany             = new CompanySP();
             PriceListSP spPriceList           = new PriceListSP();
             DataTable   dtblPriceList         = spPricingList.PriceListReportPrint(decGroupId, strProductName, decSizeId, decModelId, decPricingLevelId);
             DataTable   dtblCompanyReport     = spCompany.CompanyViewDataTable(1);
             DataTable   dtblPriceListGridFill = dtblPriceListReport.Copy();
             ds.Tables.Add(dtblCompanyReport);
             ds.Tables.Add(dtblPriceList);
             ds.Tables.Add(dtblOption);
             frmReport.MdiParent = formMDI.MDIObj;
             frmReport.PriceListReportPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(" RPL17:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #11
0
 /// <summary>
 /// Function to fill the ProductGroup comboBox
 /// </summary>
 public void ProductGroupComboFill()
 {
     try
     {
         DataTable   dtbl        = new DataTable();
         PriceListSP spPriceList = new PriceListSP();
         dtbl = spPriceList.PricelistProductGroupViewAllForComboBox();
         DataRow dr = dtbl.NewRow();
         dr[0] = 0;
         dr[1] = "All";
         dtbl.Rows.InsertAt(dr, 0);
         cmbProductGroup.DataSource    = dtbl;
         cmbProductGroup.ValueMember   = "groupId";
         cmbProductGroup.DisplayMember = "groupName";
     }
     catch (Exception ex)
     {
         MessageBox.Show("PCL2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #12
0
 /// <summary>
 /// Function to fill the ProductGroup comboBox
 /// </summary>
 public void ProductGroupComboFill()
 {
     try
     {
         DataTable dtbl = new DataTable();
         PriceListSP spPriceList = new PriceListSP();
         dtbl = spPriceList.PricelistProductGroupViewAllForComboBox();
         DataRow dr = dtbl.NewRow();
         dr[0] = 0;
         dr[1] = "All";
         dtbl.Rows.InsertAt(dr, 0);
         cmbProductGroup.DataSource = dtbl;
         cmbProductGroup.ValueMember = "groupId";
         cmbProductGroup.DisplayMember = "groupName";
     }
     catch (Exception ex)
     {
         MessageBox.Show("PCL2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #13
0
 /// <summary>
 /// Function to fill the ProductGroup comboBox
 /// </summary>
 public void ProductGroupComboFill()
 {
     try
     {
         DataTable   dtbl        = new DataTable();
         PriceListSP spPriceList = new PriceListSP();
         dtbl = spPriceList.PricelistProductGroupViewAllForComboBox();
         DataRow dr = dtbl.NewRow();
         dr[0] = 0;
         dr[1] = "All";
         dtbl.Rows.InsertAt(dr, 0);
         cmbProductGroup.DataSource    = dtbl;
         cmbProductGroup.ValueMember   = "groupId";
         cmbProductGroup.DisplayMember = "groupName";
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PCL2" + ex.Message;
     }
 }
Example #14
0
 /// <summary>
 /// Function to delete the pricelist for the product
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         PriceListSP spPriceList = new PriceListSP();
         if (spPriceList.PriceListCheckReferenceAndDelete(decPriceLevelId) <= 0)
         {
             Messages.ReferenceExistsMessage();
         }
         else
         {
             Messages.DeletedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PLP8" + ex.Message + ex.Message;
     }
 }
 /// <summary>
 /// Function to delete the pricelist for the product
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         PriceListSP spPriceList = new PriceListSP();
         if (spPriceList.PriceListCheckReferenceAndDelete(decPricingLevelId) <= 0)
         {
             Messages.ReferenceExistsMessage();
         }
         else
         {
             spPriceList.PriceListDelete(decpriceListId);
             Messages.DeletedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #16
0
 /// <summary>
 /// Function to fill the grid based on the
 /// </summary>
 public void GridFill()
 {
     try
     {
         {
             DataTable   dtbl        = new DataTable();
             PriceListSP spPriceList = new PriceListSP();
             if (cmbProductGroup.Text == "All")
             {
                 cmbProductGroup.Text = "All";
             }
             cmbPricingLevel.Text = cmbPricingLevel.Text;
             dtbl = spPriceList.ProductDetailsViewGridfill(Convert.ToDecimal(cmbProductGroup.SelectedValue.ToString()), txtProductCode.Text, txtProductName.Text, cmbPricingLevel.Text);
             dgvPricingList.DataSource = dtbl;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PCL4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #17
0
 /// <summary>
 /// Function to fill the grid based on the
 /// </summary>
 public void GridFill()
 {
     try
     {
         {
             DataTable   dtbl        = new DataTable();
             PriceListSP spPriceList = new PriceListSP();
             if (cmbProductGroup.Text == "All")
             {
                 cmbProductGroup.Text = "All";
             }
             cmbPricingLevel.Text = cmbPricingLevel.Text;
             dtbl = spPriceList.ProductDetailsViewGridfill(Convert.ToDecimal(cmbProductGroup.SelectedValue.ToString()), txtProductCode.Text, txtProductName.Text, cmbPricingLevel.Text);
             dgvPricingList.DataSource = dtbl;
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PCL4" + ex.Message;
     }
 }
 /// <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)
     {
         MessageBox.Show("PLP9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #19
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;
     }
 }
Example #20
0
        /// <summary>
        ///  Function to fil Controls based on the ProductName
        /// </summary>
        /// <param name="decProductId"></param>
        public void FillControlsByProductName(decimal decProductId)
        {
            try
            {
                PriceListInfo InfoPriceList = new PriceListInfo();
                ProductInfo infoProduct = new ProductInfo();
                ProductSP spProduct = new ProductSP();
                PriceListSP spPriceList = new PriceListSP();
                ProductBatchInfo infoProductBatch = new ProductBatchInfo();
                infoProduct = new ProductSP().ProductView(decProductId);
                txtProductCode.Text = infoProduct.ProductCode;
                infoProductBatch = spProduct.BarcodeViewByProductCode(txtProductCode.Text);
                decProductId = infoProductBatch.ProductId;
                decBatchId = infoProductBatch.BatchId;
                InfoPriceList = spPriceList.PriceListViewByBatchIdORProduct(decBatchId);
                batchcombofill();
                txtBarcode.Text = infoProductBatch.Barcode;
                cmbItem.Text = infoProduct.ProductName;
                cmbGodown.SelectedValue = infoProduct.GodownId;
                cmbRack.SelectedValue = infoProduct.RackId;
                UnitComboFill();
                UnitInfo infoUnit = new UnitInfo();
                infoUnit = new UnitSP().unitVieWForStandardRate(decProductId);
                cmbUnit.SelectedValue = infoUnit.UnitId;
                if (InfoPriceList.PricinglevelId != 0)
                {
                    cmbPricingLevel.SelectedValue = InfoPriceList.PricinglevelId;
                }
                else
                {
                    cmbPricingLevel.SelectedIndex = 0;
                }
                ComboTaxFill();
                cmbTax.SelectedValue = infoProduct.TaxId;
                if (txtProductCode.Text.Trim() != string.Empty && cmbItem.SelectedIndex != -1)
                {
                    decimal decNodecplaces = PublicVariables._inNoOfDecimalPlaces;
                    decimal dcRate = new ProductSP().ProductRateForSales(decProductId, Convert.ToDateTime(txtDate.Text), decBatchId, decNodecplaces);
                    txtRate.Text = dcRate.ToString();
                    try
                    {
                        if (decimal.Parse(txtQuantity.Text) == 0)
                            txtQuantity.Text = "1";
                    }
                    catch { txtQuantity.Text = "1"; }
                    txtQuantity.Focus();

                }
                TaxAmountCalculation();
                isAfterFillControls = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("POS:27" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #21
0
 /// <summary>
 /// Function to fill the grid based on the
 /// </summary>
 public void GridFill()
 {
     try
     {
         {
             DataTable dtbl = new DataTable();
             PriceListSP spPriceList = new PriceListSP();
             if (cmbProductGroup.Text == "All")
             {
                 cmbProductGroup.Text = "All";
             }
             cmbPricingLevel.Text = cmbPricingLevel.Text;
             dtbl = spPriceList.ProductDetailsViewGridfill(Convert.ToDecimal(cmbProductGroup.SelectedValue.ToString()), txtProductCode.Text, txtProductName.Text, cmbPricingLevel.Text);
             dgvPricingList.DataSource = dtbl;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PCL4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #22
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)
     {
         MessageBox.Show("PLP9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #23
0
 /// <summary>
 /// Function to fill the pricelist details in datagridview 
 /// </summary>
 public void PriceListPopupGridFill()
 {
     try
     {
         DataTable dtbl = new DataTable();
         PriceListSP spPriceList = new PriceListSP();
         dtbl = spPriceList.PriceListPopupGridFill(decPricingLevelMain, decProductMain);
         dgvProductGroup.DataSource = dtbl;
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP10" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #24
0
 /// <summary>
 /// Function to delete the pricelist for the product 
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         PriceListSP spPriceList = new PriceListSP();
         if (spPriceList.PriceListCheckReferenceAndDelete(decPricingLevelId) <= 0)
         {
             Messages.ReferenceExistsMessage();
         }
         else
         {
             spPriceList.PriceListDelete(decpriceListId);
             Messages.DeletedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #25
0
 /// <summary>
 /// Function to edit the pricelist
 /// </summary>
 public void EditFunction()
 {
     try
     {
         if (txtRate.Text.Trim() == String.Empty)
         {
             Messages.InformationMessage("Enter rate");
             txtRate.Focus();
         }
         else if (Convert.ToDecimal(txtRate.Text) == 0)
         {
             PriceListSP spPriceList = new PriceListSP();
             spPriceList.PriceListDelete(deca);
             Messages.UpdatedMessage();
             if (frmPriceListobj != null)
             {
                 this.Close();
             }
         }
         else
         {
             PriceListSP spPriceList = new PriceListSP();
             PriceListInfo infoPriceList = new PriceListInfo();
             infoPriceList.ProductId = decProductMain;
             infoPriceList.PricelistId = Convert.ToDecimal(dgvProductGroup.CurrentRow.Cells["dgvtxtPriceListId"].Value.ToString());
             infoPriceList.PricinglevelId = decPricingLevelMain;
             infoPriceList.UnitId = decUnitId;
             infoPriceList.BatchId = decBatchId;
             infoPriceList.Rate = Convert.ToDecimal(txtRate.Text);
             infoPriceList.Extra1 = string.Empty;
             infoPriceList.Extra2 = string.Empty;
             spPriceList.PriceListEdit(infoPriceList);
             Messages.UpdatedMessage();
             Clear();
             if (frmPriceListobj != null)
             {
                 this.Close();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #26
0
 /// <summary>
 /// Function to save the new pricelist for the product
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         PriceListSP spPriceList = new PriceListSP();
         PriceListInfo infoPriceList = new PriceListInfo();
         infoPriceList.ProductId = decProductMain;
         infoPriceList.PricinglevelId = decPricingLevelMain;
         infoPriceList.UnitId = decUnitId;
         infoPriceList.BatchId = Convert.ToDecimal(cmbBatch.SelectedValue.ToString());
         infoPriceList.Rate = Convert.ToDecimal(txtRate.Text);
         infoPriceList.Extra1 = string.Empty;
         infoPriceList.Extra2 = string.Empty;
         if (spPriceList.PriceListCheckExistence(0, decPricingLevelMain, Convert.ToDecimal(cmbBatch.SelectedValue.ToString()), decProductMain) == true)
         {
             spPriceList.PriceListAdd(infoPriceList);
             Messages.SavedMessage();
             Clear();
         }
         else
         {
             Messages.InformationMessage("Price List already exist for selected product and batches");
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #27
0
 /// <summary>
 /// On print button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvPriceList.Rows.Count > 0)
         {
             frmReport frmReport = new frmReport();
             frmReport.MdiParent = formMDI.MDIObj;
             DataTable dtblOption = new DataTable();
             dtblOption.Columns.Add("PurchaseRate", typeof(String));
             dtblOption.Columns.Add("SalesRate", typeof(String));
             dtblOption.Columns.Add("LastSalesRate", typeof(String));
             dtblOption.Columns.Add("StandardRate", typeof(String));
             dtblOption.Columns.Add("MRP", typeof(String));
             dtblOption.Columns.Add("Price", typeof(String));
             DataRow dr = dtblOption.NewRow();
             dr["PurchaseRate"] = cbxPurchaseRate.Checked?"True":"False";
             dr["SalesRate"] = cbxSalesRate.Checked ? "True" : "False";
             dr["LastSalesRate"] = cbxlastSalesRate.Checked ? "True" : "False";
             dr["StandardRate"] = CbxStandardRate.Checked ? "True" : "False";
             dr["MRP"] = cbxMrp.Checked ? "True" : "False";
             dr["Price"] = "True";
             dtblOption.Rows.Add(dr);
             DataSet ds = new DataSet();
             CompanySP spCompany = new CompanySP();
             PriceListSP spPriceList = new PriceListSP();
             DataTable dtblPriceList = spPricingList.PriceListReportPrint(decGroupId, strProductName, decSizeId, decModelId, decPricingLevelId);
             DataTable dtblCompanyReport = spCompany.CompanyViewDataTable(1);
             DataTable dtblPriceListGridFill = dtblPriceListReport.Copy();
             ds.Tables.Add(dtblCompanyReport);
             ds.Tables.Add(dtblPriceList);
             ds.Tables.Add(dtblOption);
             frmReport.MdiParent = formMDI.MDIObj;
             frmReport.PriceListReportPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(" RPL17:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #28
0
 /// <summary>
 /// Function to fill the pricelevel combobox
 /// </summary>
 public void PricelevelComboFill()
 {
     try
     {
         DataTable dtbl = new DataTable();
         PriceListSP spPriceList = new PriceListSP();
         dtbl = spPriceList.PricelistPricingLevelViewAllForComboBox();
         cmbPricingLevel.DataSource = dtbl;
         cmbPricingLevel.ValueMember = "pricinglevelId";
         cmbPricingLevel.DisplayMember = "pricinglevelName";
     }
     catch (Exception ex)
     {
         MessageBox.Show("PCL3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }