public void Post([FromBody] SupplierLedgerBook sup) { if (ModelState.IsValid) { SupplierLedgerBookRepository.Add(sup); } }
public void Put(int id, [FromBody] SupplierLedgerBook sup) { sup.Id = id; if (ModelState.IsValid) { SupplierLedgerBookRepository.Update(sup); } }
public void Add(SupplierLedgerBook vou) { using (IDbConnection dbConnection = Connection) { string sQuery = "INSERT INTO SupplierLedgerBook ( Date , Name, LedgerNo,Label, Debit, Credit, PartyID)" + " VALUES( @Date, @Name, @LedgerNo,@Label,@Debit,@Credit,@PartyID)"; dbConnection.Open(); dbConnection.Execute(sQuery, vou); } }
public void Update(SupplierLedgerBook sup) { using (IDbConnection dbConnection = Connection) { string sQuery = " UPDATE SupplierLedgerBook SET Date = @Date," + " Name = @Name, LedgerNo = @LedgerNo," + "Label=@Label,Debit=@Debit," + "Credit=@Credit,PartyID=@PartyID" + " WHERE Id = @Id"; dbConnection.Open(); dbConnection.Execute(sQuery, sup); } }