Example #1
0
        public ActionResult Edit([Bind(Include = "EmploymentTypeID,EmploymentType1,dataIsCreated,dataIsUpdated,isActive,isSelected,createdBy,modifiedBy")] NewLetter.Models.EmploymentType employmentType)
        {
            try
            {
                var s = repo.Single(employmentType.EmploymentTypeID);
                if (s == null)
                {
                    return(HttpNotFound());
                }
                s.EmploymentType1 = employmentType.EmploymentType1;
                s.dataIsUpdated   = BaseUtil.GetCurrentDateTime();
                s.isActive        = employmentType.isActive;
                s.isSelected      = employmentType.isSelected;
                s.modifiedBy      = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.employerID.ToString()));
                if (ModelState.IsValid)
                {
                    repo.Update(s);
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception e)
            {
                BaseUtil.CaptureErrorValues(e);
            }

            return(View(employmentType));
        }
Example #2
0
 public ActionResult Create([Bind(Include = "EmploymentTypeID,EmploymentType1,dataIsCreated,dataIsUpdated,isActive,isSelected,createdBy,modifiedBy")] NewLetter.Models.EmploymentType employmentType)
 {
     try
     {
         employmentType.createdBy     = Convert.ToInt64((BaseUtil.GetSessionValue(AdminInfo.employerID.ToString())));
         employmentType.modifiedBy    = Convert.ToInt64((BaseUtil.GetSessionValue(AdminInfo.employerID.ToString())));
         employmentType.dataIsCreated = BaseUtil.GetCurrentDateTime();
         employmentType.dataIsUpdated = BaseUtil.GetCurrentDateTime();
         if (ModelState.IsValid)
         {
             repo.Insert(employmentType);
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception e)
     {
         BaseUtil.CaptureErrorValues(e);
     }
     return(View(employmentType));
 }