public void Post([FromBody] PayrollArchiveHeaderModel payroll) { if (payroll.Id != 0) { _accounting.Update(payroll); } else { _accounting.Insert(payroll); } }
public void Update(PayrollArchiveHeaderModel payroll) { try { _sql.StartTransaction("AccountingConnStr"); _sql.SaveDataInTransaction("dbo.spPayrollAccounting_Update", payroll); } catch (System.Exception) { _sql.RollBackTransaction(); throw; } }
private void InsertAccountingHeader(PayrollArchiveHeaderModel accounting) { try { _sql.StartTransaction("AccountingConnStr"); _sql.SaveDataInTransaction("dbo.spPayrollArchiveHeader_Insert", accounting); } catch (Exception) { _sql.RollBackTransaction(); throw; } _sql.Dispose(); }