示例#1
0
 public void Post([FromBody] SupplierLedgerBook sup)
 {
     if (ModelState.IsValid)
     {
         SupplierLedgerBookRepository.Add(sup);
     }
 }
示例#2
0
 public void Put(int id, [FromBody] SupplierLedgerBook sup)
 {
     sup.Id = id;
     if (ModelState.IsValid)
     {
         SupplierLedgerBookRepository.Update(sup);
     }
 }
示例#3
0
 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);
     }
 }
示例#4
0
 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);
     }
 }