// GET: PayrollOption
        public ActionResult Index()
        {
            var objs = PayrollOption.GetAll();
            var obj  = new PayrollOption();

            if (objs != null && objs.Count > 0)
            {
                obj = objs.FirstOrDefault();
            }
            return(PartialView(obj));
        }
 public ActionResult Edit(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add update logic here
         var model = PayrollOption.GetById(id);
         TryUpdateModel(model);
         model.SaveOrUpDate();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Create(FormCollection collection)
 {
     try
     {
         // TODO: Add insert logic here
         var model = new PayrollOption();
         TryUpdateModel(model);
         model.Insert();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
        public ActionResult SavePayrollOption(FormCollection collection)
        {
            var result = new ResultModel();
            var model  = new PayrollOption();

            TryUpdateModel(model);
            if (model.id > 0)
            {
                result = model.SaveOrUpDate();
            }
            else
            {
                result = model.Insert();
            }
            result.ObjectResult = model;

            return(new JsonResult()
            {
                Data = result
            });
        }
 // GET: PayrollOption/Edit/5
 public ActionResult Edit(int id)
 {
     return(View(PayrollOption.GetById(id)));
 }