/// <summary> /// Function to get Product Tax for Search /// </summary> /// <param name="infoProduct"></param> /// <param name="inSelect"></param> /// <returns></returns> public List<DataTable> ChangeProductTaxSearch(ProductInfo infoProduct, int inSelect) { List<DataTable> listObj = new List<DataTable>(); DataTable dtbl = new DataTable(); dtbl.Columns.Add("SlNo", typeof(int)); dtbl.Columns["SlNo"].AutoIncrement = true; dtbl.Columns["SlNo"].AutoIncrementSeed = 1; dtbl.Columns["SlNo"].AutoIncrementStep = 1; try { if (sqlcon.State == ConnectionState.Closed) { sqlcon.Open(); } SqlDataAdapter sdaadapter = new SqlDataAdapter("ChangeProductTaxSearch", sqlcon); sdaadapter.SelectCommand.CommandType = CommandType.StoredProcedure; sdaadapter.SelectCommand.Parameters.Add("@groupId", SqlDbType.Decimal).Value = infoProduct.GroupId; sdaadapter.SelectCommand.Parameters.Add("@productCode", SqlDbType.VarChar).Value = infoProduct.ProductCode; sdaadapter.SelectCommand.Parameters.Add("@productName", SqlDbType.VarChar).Value = infoProduct.ProductName; sdaadapter.SelectCommand.Parameters.Add("@taxID", SqlDbType.Decimal).Value = infoProduct.TaxId; sdaadapter.Fill(dtbl); listObj.Add(dtbl); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { sqlcon.Close(); } return listObj; }
/// <summary> /// Change Product Tax to save /// </summary> /// <param name="productinfo"></param> public void ChangeProductTaxSave(ProductInfo productinfo) { try { if (sqlcon.State == ConnectionState.Closed) { sqlcon.Open(); } SqlCommand sccmd = new SqlCommand("ChangeProductTaxSave", sqlcon); sccmd.CommandType = CommandType.StoredProcedure; SqlParameter sprmparam = new SqlParameter(); sprmparam = sccmd.Parameters.Add("@productId", SqlDbType.Decimal); sprmparam.Value = productinfo.ProductId; sprmparam = sccmd.Parameters.Add("@taxId", SqlDbType.VarChar); sprmparam.Value = productinfo.TaxId; sccmd.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { sqlcon.Close(); } }
/// <summary> /// product View By ProductId /// </summary> /// <param name="decproductId"></param> /// <returns></returns> public ProductInfo productViewByProductId(decimal decproductId) { ProductInfo infoproduct = new ProductInfo(); SqlDataReader sqldr = null; try { if (sqlcon.State == ConnectionState.Closed) { sqlcon.Open(); } SqlCommand cmd = new SqlCommand("ProductViewByProductId", sqlcon); cmd.CommandType = CommandType.StoredProcedure; SqlParameter sqlparam = new SqlParameter(); sqlparam = cmd.Parameters.Add("@productId", SqlDbType.Decimal); sqlparam.Value = decproductId; sqldr = cmd.ExecuteReader(); while (sqldr.Read()) { infoproduct.ProductCode = sqldr["productCode"].ToString(); infoproduct.ProductName = sqldr["productName"].ToString(); infoproduct.UnitId = Convert.ToDecimal(sqldr["unitId"].ToString()); infoproduct.GodownId = Convert.ToDecimal(sqldr["godownId"].ToString()); infoproduct.RackId = Convert.ToDecimal(sqldr["rackId"].ToString()); infoproduct.IsallowBatch = Convert.ToBoolean(sqldr["isallowBatch"].ToString()); infoproduct.GroupId = Convert.ToDecimal(sqldr["groupId"].ToString()); infoproduct.BrandId = Convert.ToDecimal(sqldr["brandId"].ToString()); infoproduct.Ismultipleunit = Convert.ToBoolean(sqldr["ismultipleunit"].ToString()); if (sqldr["extraDate"].ToString() != null) infoproduct.ExtraDate = Convert.ToDateTime(sqldr["extraDate"].ToString()); infoproduct.Extra1 = sqldr["extra1"].ToString(); infoproduct.Extra2 = sqldr["extra2"].ToString(); infoproduct.PartNo = sqldr["partNo"].ToString(); } } catch (Exception ex) { MessageBox.Show("productSp:" + ex.Message.ToString()); } finally { sqldr.Close(); sqlcon.Close(); } return infoproduct; }
/// <summary> /// Product details View For StandardRate form /// </summary> /// <param name="decProductId"></param> /// <returns></returns> public ProductInfo ProductViewForStandardRate(decimal decProductId) { ProductInfo infoProduct = new ProductInfo(); try { infoProduct = spProduct.ProductViewForStandardRate(decProductId); } catch (Exception ex) { MessageBox.Show("PC25:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return infoProduct; }
/// <summary> /// product details view by productname for fill other forms /// </summary> /// <param name="strproductName"></param> /// <returns></returns> public ProductInfo ProductViewByName(string strproductName) { ProductInfo productinfo = new ProductInfo(); SqlDataReader sdrreader = null; try { if (sqlcon.State == ConnectionState.Closed) { sqlcon.Open(); } SqlCommand sccmd = new SqlCommand("ProductViewByName", sqlcon); sccmd.CommandType = CommandType.StoredProcedure; SqlParameter sprmparam = new SqlParameter(); sprmparam = sccmd.Parameters.Add("@productName", SqlDbType.VarChar); sprmparam.Value = strproductName; sdrreader = sccmd.ExecuteReader(); while (sdrreader.Read()) { productinfo.ProductId = Convert.ToDecimal(sdrreader[0].ToString()); productinfo.ProductCode = sdrreader[1].ToString(); productinfo.ProductName = sdrreader[2].ToString(); productinfo.GroupId = Convert.ToDecimal(sdrreader[3].ToString()); productinfo.BrandId = Convert.ToDecimal(sdrreader[4].ToString()); productinfo.UnitId = Convert.ToDecimal(sdrreader[5].ToString()); productinfo.SizeId = Convert.ToDecimal(sdrreader[6].ToString()); productinfo.ModelNoId = Convert.ToDecimal(sdrreader[7].ToString()); productinfo.TaxId = Convert.ToDecimal(sdrreader[8].ToString()); productinfo.TaxapplicableOn = sdrreader[9].ToString(); productinfo.PurchaseRate = Convert.ToDecimal(sdrreader[10].ToString()); productinfo.SalesRate = Convert.ToDecimal(sdrreader[11].ToString()); productinfo.Mrp = Convert.ToDecimal(sdrreader[12].ToString()); productinfo.MinimumStock = Convert.ToDecimal(sdrreader[13].ToString()); productinfo.MaximumStock = Convert.ToDecimal(sdrreader[14].ToString()); productinfo.ReorderLevel = Convert.ToDecimal(sdrreader[15].ToString()); productinfo.GodownId = Convert.ToDecimal(sdrreader[16].ToString()); productinfo.RackId = Convert.ToDecimal(sdrreader[17].ToString()); productinfo.IsallowBatch = bool.Parse(sdrreader[18].ToString()); productinfo.Ismultipleunit = bool.Parse(sdrreader[19].ToString()); productinfo.IsBom = bool.Parse(sdrreader[20].ToString()); productinfo.Isopeningstock = bool.Parse(sdrreader[21].ToString()); productinfo.Narration = sdrreader[22].ToString(); productinfo.IsActive = bool.Parse(sdrreader[23].ToString()); productinfo.IsshowRemember = bool.Parse(sdrreader[24].ToString()); productinfo.Extra1 = sdrreader[25].ToString(); productinfo.Extra2 = sdrreader[26].ToString(); productinfo.ExtraDate = PublicVariables._dtCurrentDate;// DateTime.Parse(sdrreader[27].ToString()); productinfo.PartNo = sdrreader[28].ToString(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { sdrreader.Close(); sqlcon.Close(); } return productinfo; }
public ProductInfo ProductView(decimal productId) { ProductInfo InfoProduct = new ProductInfo(); try { InfoProduct = SPProduct.ProductView(productId); } catch (Exception ex) { MessageBox.Show("PD7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return InfoProduct; }
/// <summary> /// product View By ProductId /// </summary> /// <param name="decproductId"></param> /// <returns></returns> public ProductInfo productViewByProductId(decimal decproductId) { ProductInfo infoproduct = new ProductInfo(); try { infoproduct = spProduct.productViewByProductId(decproductId); } catch (Exception ex) { MessageBox.Show("PC48:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return infoproduct; }
/// <summary> /// Function to Update values in Product Table /// </summary> /// <param name="productinfo"></param> /// <returns></returns> public bool ProductEdit(ProductInfo productinfo) { bool isResult = false; try { isResult = spProduct.ProductEdit(productinfo); } catch (Exception ex) { MessageBox.Show("PC38:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return isResult; }
/// <summary> /// Function to get particular values from Product Table based on the parameter /// </summary> /// <param name="productId"></param> /// <returns></returns> public ProductInfo ProductView(decimal productId) { ProductInfo productinfo = new ProductInfo(); try { productinfo = spProduct.ProductView(productId); } catch (Exception ex) { MessageBox.Show("PC9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return productinfo; }
/// <summary> /// PriceList PopUp View based on productId /// </summary> /// <param name="decProductId"></param> /// <returns></returns> public ProductInfo PriceListPopUpView(decimal decProductId) { ProductInfo infoProduct = new ProductInfo(); try { infoProduct = spProduct.PriceListPopUpView(decProductId); } catch (Exception ex) { MessageBox.Show("PC21:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return infoProduct; }
/// <summary> /// Function to insert values to Product Table /// </summary> /// <param name="productinfo"></param> /// <returns></returns> public decimal ProductAdd(ProductInfo productinfo) { decimal decIdentity = 0; try { decIdentity = spProduct.ProductAdd(productinfo); } catch (Exception ex) { MessageBox.Show("PC30:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return decIdentity; }
/// <summary> /// Function to get Product Tax for Search /// </summary> /// <param name="infoProduct"></param> /// <param name="inSelect"></param> /// <returns></returns> public List<DataTable> ChangeProductTaxSearch(ProductInfo infoProduct, int inSelect) { List<DataTable> listObj = new List<DataTable>(); try { listObj = spProduct.ChangeProductTaxSearch(infoProduct, inSelect); } catch (Exception ex) { MessageBox.Show("PC47:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return listObj; }
/// <summary> /// Change Product Tax to save /// </summary> /// <param name="productinfo"></param> public void ChangeProductTaxSave(ProductInfo productinfo) { try { spProduct.ChangeProductTaxSave(productinfo); } catch (Exception ex) { MessageBox.Show("PC23:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public ProductInfo ProductViewByName(string strproductName) { ProductInfo InfoProduct = new ProductInfo(); try { InfoProduct = SPProduct.ProductViewByName(strproductName); } catch (Exception ex) { MessageBox.Show("PD28:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return InfoProduct; }
/// <summary> /// PriceList PopUp View based on productId /// </summary> /// <param name="decProductId"></param> /// <returns></returns> public ProductInfo PriceListPopUpView(decimal decProductId) { ProductInfo infoProduct = new ProductInfo(); SqlDataReader sqldr = null; try { if (sqlcon.State == ConnectionState.Closed) { sqlcon.Open(); } SqlCommand sqlcmd = new SqlCommand("PriceListPopUpView", sqlcon); sqlcmd.CommandType = CommandType.StoredProcedure; sqlcmd.Parameters.Add("@productId", SqlDbType.Decimal).Value = decProductId; sqldr = sqlcmd.ExecuteReader(); while (sqldr.Read()) { infoProduct.ProductId = Convert.ToDecimal(sqldr["productId"].ToString()); infoProduct.ProductName = (sqldr["productName"].ToString()); infoProduct.ProductCode = (sqldr["productCode"].ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { sqlcon.Close(); sqldr.Close(); } return infoProduct; }
/// <summary> /// product details view by productname for fill other forms /// </summary> /// <param name="strproductName"></param> /// <returns></returns> public ProductInfo ProductViewByName(string strproductName) { ProductInfo productinfo = new ProductInfo(); try { productinfo = spProduct.ProductViewByName(strproductName); } catch (Exception ex) { MessageBox.Show("PC42:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return productinfo; }
/// <summary> /// Function to Update values in Product Table /// </summary> /// <param name="productinfo"></param> /// <returns></returns> public bool ProductEdit(ProductInfo productinfo) { decimal decCheck = 0; bool isResult = false; try { if (sqlcon.State == ConnectionState.Closed) { sqlcon.Open(); } SqlCommand sccmd = new SqlCommand("ProductEdit", sqlcon); sccmd.CommandType = CommandType.StoredProcedure; SqlParameter sprmparam = new SqlParameter(); sprmparam = sccmd.Parameters.Add("@productId", SqlDbType.Decimal); sprmparam.Value = productinfo.ProductId; sprmparam = sccmd.Parameters.Add("@productCode", SqlDbType.VarChar); sprmparam.Value = productinfo.ProductCode; sprmparam = sccmd.Parameters.Add("@productName", SqlDbType.VarChar); sprmparam.Value = productinfo.ProductName; sprmparam = sccmd.Parameters.Add("@groupId", SqlDbType.Decimal); sprmparam.Value = productinfo.GroupId; sprmparam = sccmd.Parameters.Add("@brandId", SqlDbType.Decimal); sprmparam.Value = productinfo.BrandId; sprmparam = sccmd.Parameters.Add("@unitId", SqlDbType.Decimal); sprmparam.Value = productinfo.UnitId; sprmparam = sccmd.Parameters.Add("@sizeId", SqlDbType.Decimal); sprmparam.Value = productinfo.SizeId; sprmparam = sccmd.Parameters.Add("@modelNoId", SqlDbType.Decimal); sprmparam.Value = productinfo.ModelNoId; sprmparam = sccmd.Parameters.Add("@taxId", SqlDbType.Decimal); sprmparam.Value = productinfo.TaxId; sprmparam = sccmd.Parameters.Add("@taxapplicableOn", SqlDbType.VarChar); sprmparam.Value = productinfo.TaxapplicableOn; sprmparam = sccmd.Parameters.Add("@purchaseRate", SqlDbType.Decimal); sprmparam.Value = productinfo.PurchaseRate; sprmparam = sccmd.Parameters.Add("@salesRate", SqlDbType.Decimal); sprmparam.Value = productinfo.SalesRate; sprmparam = sccmd.Parameters.Add("@mrp", SqlDbType.Decimal); sprmparam.Value = productinfo.Mrp; sprmparam = sccmd.Parameters.Add("@minimumStock", SqlDbType.Decimal); sprmparam.Value = productinfo.MinimumStock; sprmparam = sccmd.Parameters.Add("@maximumStock", SqlDbType.Decimal); sprmparam.Value = productinfo.MaximumStock; sprmparam = sccmd.Parameters.Add("@reorderLevel", SqlDbType.Decimal); sprmparam.Value = productinfo.ReorderLevel; sprmparam = sccmd.Parameters.Add("@godownId", SqlDbType.Decimal); sprmparam.Value = productinfo.GodownId; sprmparam = sccmd.Parameters.Add("@rackId", SqlDbType.Decimal); sprmparam.Value = productinfo.RackId; sprmparam = sccmd.Parameters.Add("@isallowBatch", SqlDbType.Bit); sprmparam.Value = productinfo.IsallowBatch; sprmparam = sccmd.Parameters.Add("@ismultipleunit", SqlDbType.Bit); sprmparam.Value = productinfo.Ismultipleunit; sprmparam = sccmd.Parameters.Add("@isBom", SqlDbType.Bit); sprmparam.Value = productinfo.IsBom; sprmparam = sccmd.Parameters.Add("@isopeningstock", SqlDbType.Bit); sprmparam.Value = productinfo.Isopeningstock; sprmparam = sccmd.Parameters.Add("@narration", SqlDbType.VarChar); sprmparam.Value = productinfo.Narration; sprmparam = sccmd.Parameters.Add("@isActive", SqlDbType.Bit); sprmparam.Value = productinfo.IsActive; sprmparam = sccmd.Parameters.Add("@isshowRemember", SqlDbType.Bit); sprmparam.Value = productinfo.IsshowRemember; sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar); sprmparam.Value = productinfo.Extra1; sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar); sprmparam.Value = productinfo.Extra2; sprmparam = sccmd.Parameters.Add("@extraDate", SqlDbType.DateTime); sprmparam.Value = productinfo.ExtraDate; decCheck = sccmd.ExecuteNonQuery(); if (decCheck > 0) { isResult = true; } else { isResult = false; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { sqlcon.Close(); } return isResult; }
public ProductInfo ProductViewByProductIdforSalesInvoice(string strproductCode) { try { InfoProduct = SPSalesMaster.ProductViewByProductIdforSalesInvoice(strproductCode); } catch (Exception ex) { MessageBox.Show("CB:4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return InfoProduct; }