public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Module = new TModuleClass(); var res = Module.ModuleSelectByID(id).FirstOrDefault(); if (res == null) { return(HttpNotFound()); } TModuleModel mdl = new TModuleModel(); mdl.IDModule = res.IDModule; mdl.ModuleCode = res.ModuleCode; mdl.ModuleDesc = res.ModuleDesc; mdl.ModuleName = res.ModuleName; mdl.Sequence = res.Sequence; mdl.IsDefault = res.IsDefault; mdl.UserEntry = res.UserEntry; mdl.DateEntry = ConvertDate.convert_date(res.DateEntry); mdl.UserLastMaintenance = res.UserLastMaintenance; mdl.DateLastMaintenance = ConvertDate.convert_date(res.DateLastMaintenance); mdl.IDIcon = res.IDIcon; mdl.IDIconModule = res.IDIcon; mdl.IconClass = res.IconClass; mdl.IconName = res.IconName; return(View(mdl)); }
public ActionResult Delete(String id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Module = new TModuleClass(); var res = Module.ModuleSelectByID(id).FirstOrDefault(); if (res == null) { return(HttpNotFound()); } TModuleModel mdl = new TModuleModel(); var CUI = Session["CurrentUICulture"].ToString(); mdl.IDModule = res.IDModule; mdl.ModuleCode = res.ModuleCode; mdl.ModuleDesc = res.ModuleDesc; mdl.ModuleName = res.ModuleName; mdl.Sequence = res.Sequence; mdl.IsDefault = res.IsDefault; mdl.UserEntry = res.UserEntry; mdl.DateEntry = res.DateEntry.ToString(CultureInfo.CreateSpecificCulture(CUI).DateTimeFormat); mdl.UserLastMaintenance = res.UserLastMaintenance; mdl.DateLastMaintenance = res.DateLastMaintenance.HasValue ? res.DateLastMaintenance.Value.ToString(CultureInfo.CreateSpecificCulture(CUI).DateTimeFormat) : string.Empty; mdl.IDIcon = res.IDIcon; mdl.IconClass = res.IconClass; mdl.IconName = res.IconName; mdl.IconType = res.IconType; mdl.IconPath = res.IconPath; return(View(mdl)); }