// POST api/accountledger public void Post(AccountLedgerModel a) { AccountLedgerModel model = new AccountLedgerModel(); model.AccountLedgerId = a.AccountLedgerIdPk; model.AccountLegderName = a.AccountLegderName; model.AccountTypeId = a.AccountTypeId; model.CrAmount = a.CrAmount; model.DrAmount = a.DrAmount; model.OpeningBalance = a.OpeningBalance; model.AccountGroupId = a.AccountGroupId; model.IsActive = a.IsActive; int i = AccountLedgerProvider.insertAccountLedger(model); }
public static int insertAccountLedger(AccountLedgerModel a) { try { string cmd1 = "insert into AccountLedger( AccountLedgerId,AccountTypeId,AccountGroupId,AccountLegderName,OpeningBalance,CrAmount ,DrAmount,IsActive) values(@AccountLedgerID,@AccountTypeId,@AccountGroupId,@AccountLegderName,@OpeningBalance,@CrAmount,@DrAmount,@IsActive);"; SqlHandler sql = new SqlHandler(); List <KeyValuePair <string, object> > parameter = new List <KeyValuePair <string, object> >(); parameter.Add(new KeyValuePair <string, object>("@AccountLedgerId", a.AccountLedgerId)); parameter.Add(new KeyValuePair <string, object>("@AccountTypeId", a.AccountTypeId)); parameter.Add(new KeyValuePair <string, object>("@AccountGroupId", a.AccountGroupId)); parameter.Add(new KeyValuePair <string, object>("@AccountLegderName", a.AccountLegderName)); parameter.Add(new KeyValuePair <string, object>("@OpeningBalance", a.OpeningBalance)); parameter.Add(new KeyValuePair <string, object>("@CrAmount", a.CrAmount)); parameter.Add(new KeyValuePair <string, object>("@DrAmount", a.DrAmount)); parameter.Add(new KeyValuePair <string, object>("@IsActive", a.IsActive)); int i = sql.ExecuteNonQueryCmd(cmd1, parameter); return(i); } catch (Exception ex) { throw ex; } }