public int DA_AddSaleOutwards(SaleOutwardsEntities objSaleOutwards) { int ReturnValue = 0; try { con.Open(); MySqlCommand cmd = new MySqlCommand(objQuery.insertSaleOutwards, con); cmd.Parameters.AddWithValue("@saleId", objSaleOutwards.saleId); cmd.Parameters.AddWithValue("@productId", objSaleOutwards.productId); cmd.Parameters.AddWithValue("@isActive", objSaleOutwards.isActive); cmd.Parameters.AddWithValue("@qnty", objSaleOutwards.qnty); ReturnValue = cmd.ExecuteNonQuery(); } catch (Exception ex) { ex.ToString(); } finally { con.Close(); } return(ReturnValue); }
public void AddSaleOutwards(int saleId) { int rVal = 0; try { SaleOutwardsEntities objSaleOutwards = new SaleOutwardsEntities(); objSaleOutwards.saleId = saleId; objSaleOutwards.productId = Convert.ToInt32(Product.SelectedItem.Value); objSaleOutwards.isActive = 1; objSaleOutwards.qnty = Convert.ToInt32(Quantity.Text); rVal = new BASaleMaster().BA_SaveSaleOutwards(objSaleOutwards); if (rVal > 0) { bindProducts(saleId); Response.Write("<script>alert('Added successfully...')</script>"); } } catch (Exception ex) { ex.ToString(); //throw; } }
public int BA_SaveSaleOutwards(SaleOutwardsEntities objSaleOutwards) { return(new DASaleMaster().DA_AddSaleOutwards(objSaleOutwards)); }