Пример #1
0
 public ActionResult Edit([Bind(Include = "statuts,isActive")] jobStatu jobStatu)
 {
     try
     {
         var j = repo.Single(jobStatu.jobStatusID);
         if (j == null)
         {
             return(HttpNotFound());
         }
         j.statuts       = jobStatu.statuts;
         j.isActive      = jobStatu.isActive;
         j.dataIsUpdated = BaseUtil.GetCurrentDateTime();
         j.modifiedBy    = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.UserID.ToString()));
         if (ModelState.IsValid)
         {
             repo.Update(j);
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception e)
     {
         BaseUtil.CaptureErrorValues(e);
     }
     return(View(jobStatu));
 }
Пример #2
0
        public ActionResult Create([Bind(Include = "statuts,isActive")] jobStatu jobStatu)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    jobStatu.dataIsCreated = BaseUtil.GetCurrentDateTime();
                    jobStatu.dataIsUpdated = BaseUtil.GetCurrentDateTime();
                    jobStatu.isActive      = jobStatu.isActive;
                    jobStatu.createdBy     = Convert.ToInt64((BaseUtil.GetSessionValue(AdminInfo.employerID.ToString())));
                    jobStatu.modifiedBy    = Convert.ToInt64((BaseUtil.GetSessionValue(AdminInfo.employerID.ToString())));

                    repo.Insert(jobStatu);
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception e)
            {
                BaseUtil.CaptureErrorValues(e);
            }
            return(View(jobStatu));
        }