public static int insertSaleStock(SaleStockModel s) { try { SqlHandler sql = new SqlHandler(); List <KeyValuePair <string, object> > parameter = new List <KeyValuePair <string, object> >(); parameter.Add(new KeyValuePair <string, object>("@SaleStockId", s.SaleStockId)); parameter.Add(new KeyValuePair <string, object>("@SaleStockGrossWt", s.SaleStockGrossWt)); parameter.Add(new KeyValuePair <string, object>("@SaleStockNetWt", s.SaleStockNetWt)); parameter.Add(new KeyValuePair <string, object>("@AmountPaid", s.AmountPaid)); parameter.Add(new KeyValuePair <string, object>("@StockId", s.StockId)); parameter.Add(new KeyValuePair <string, object>("@PaymentType", s.PaymentType)); parameter.Add(new KeyValuePair <string, object>("@Amount", s.Amount)); parameter.Add(new KeyValuePair <string, object>("@CrAccountId", s.CrAccountId)); parameter.Add(new KeyValuePair <string, object>("@FinancialYearId", s.FinancialYearId)); parameter.Add(new KeyValuePair <string, object>("@CompanyId", s.CompanyId)); parameter.Add(new KeyValuePair <string, object>("@insertBy", s.InsertBy)); parameter.Add(new KeyValuePair <string, object>("@insertDate", s.InsertDate)); parameter.Add(new KeyValuePair <string, object>("@DrAccountId", s.DrAccount)); parameter.Add(new KeyValuePair <string, object>("@DueGold", s.DueGold)); parameter.Add(new KeyValuePair <string, object>("@SaleInvoiceNo", s.SaleInvoiceNo)); parameter.Add(new KeyValuePair <string, object>("@transactionId", 0)); parameter.Add(new KeyValuePair <string, object>("@PaidGold", s.PaidGold)); int i = sql.ExecuteNonQueryI("Usp_AddSaleDetails", parameter); return(i); } catch (Exception ex) { throw ex; } }
// PUT api/salestock/5 public void Put(int id, SaleStockModel m) { m.SaleStockId = id; int i = SaleStockProvider.insertSaleStock(m); }
// POST api/salestock public int Post(SaleStockModel m) { int i = SaleStockProvider.insertSaleStock(m); return(i); }