public Salary SalaryDetails() { if (_salary == null) if (this.Id > 0) _salary = Salaries.Get(this.Id); return _salary; }
public JsonResult SaveSalary(Salary Salary) { try { Salary.Save(); return new JsonResult { Data = new { success = true, id = Salary.Id } }; // Return the salary Id if there are no errors } catch (Exception ex) { return new JsonResult { Data = new { success = false, error = ex.Message } }; } }