public ActionResult AddEditLicenseeType(long?licenseeTypeId)
        {
            var viewModel = new AddEditLicenseeTypeViewModel();

            if (licenseeTypeId.HasValue)
            {
                var drLicenseeType = CRCDataAccess.GetLicenseeType(licenseeTypeId.Value);
                drLicenseeType.MapTo(viewModel);

                viewModel.EnabledInd = !(drLicenseeType["DisabledDate"] is DateTime);
            }
            return(PartialView(viewModel));
        }
 public ActionResult AddEditLicenseeType(AddEditLicenseeTypeViewModel viewModel)
 {
     if (ModelState.IsValid)
     {
         CRCDataAccess.SaveLicenseeType(
             viewModel.LicenseeTypeId,
             viewModel.LicenseeTypeName,
             viewModel.EnabledInd ? (DateTime?)null : DateTime.UtcNow,
             viewModel.EnabledInd ? (long?)null : CRCUser.UserId,
             CRCUser.UserId);
         return(Json(true));
     }
     else
     {
         return(PartialView(viewModel));
     }
 }