public ActionResult Create(TFeatureModel mdl) { mdl.UserEntry = Session["IDUser"].ToString(); mdl.DateEntry = DateTime.Now.ToString(CultureInfo.CreateSpecificCulture("en-US").DateTimeFormat); mdl.UserLastMaintenance = Session["IDUser"].ToString(); mdl.DateLastMaintenance = DateTime.Now.ToString(CultureInfo.CreateSpecificCulture("en-US").DateTimeFormat); mdl.IsExternal = true; if (ModelState.IsValid) { string ret = ""; try { Feature = new TFeatureClass(); ret = Feature.FeatureInsert(mdl); return(Json(new { result = ret })); } catch (Exception err) { ret = "Err|" + err.Message; return(Json(new { result = ret })); } } else { return(View(mdl)); } }
public ActionResult FeatureDuplicate(string IDModule, string IDFeature) { string ret = ""; try { TFeatureModel mdl = new TFeatureModel(); mdl.IDModule = IDModule; mdl.IDFeatures = IDFeature; var CUI = Session["CurrentUICulture"].ToString(); DateTime DateEntry = Convert.ToDateTime(mdl.DateEntry, CultureInfo.CreateSpecificCulture(CUI)); mdl.UserEntry = Session["IDUser"].ToString(); mdl.DateEntry = DateTime.Now.ToString(); mdl.UserLastMaintenance = Session["IDUser"].ToString(); mdl.DateLastMaintenance = DateTime.Now.ToString(); TFeatureClass Feature = new TFeatureClass(); ret = Feature.FeatureDuplicate(mdl); return(Json(new { result = ret })); } catch (Exception err) { ret = "Err|" + err.Message; return(Json(new { result = ret })); } }
public ActionResult Delete(TFeatureModel mdl) { var CUI = Session["CurrentUICulture"].ToString(); DateTime DateEntry = Convert.ToDateTime(mdl.DateEntry, CultureInfo.CreateSpecificCulture(CUI)); mdl.DateEntry = DateEntry.ToString(CultureInfo.CreateSpecificCulture("en-US").DateTimeFormat); mdl.UserLastMaintenance = Session["IDUser"].ToString(); mdl.DateLastMaintenance = DateTime.Now.ToString(CultureInfo.CreateSpecificCulture("en-US").DateTimeFormat); if (ModelState.IsValid) { string ret = ""; try { Feature = new TFeatureClass(); ret = Feature.FeatureDelete(mdl); return(Json(new { result = ret })); } catch (Exception err) { ret = "Err|" + err.Message; return(Json(new { result = ret })); } } else { return(View(mdl)); } }
public ActionResult GetDataFeatureByIDModule(string sEcho, int Start, int Length, string IDModule) { var FeatureClass = new TFeatureClass(); //Length = 100; //var res = FeatureClass.FeatureSelectByIDModule(IDModule); // var displaytable = res.Skip(Start).Take(Length); var res = FeatureClass.GetDataFeatureByModule(Start, Length, IDModule); Int32?TotalRecords; if (res.Count() > 0) { TotalRecords = res.FirstOrDefault().TotalRecord; } else { TotalRecords = 0; } var resultnya = from d in res select new string[] { d.FeaturesCode, d.FeaturesName, d.FeaturesDesc, d.FeaturesType, d.FeaturesAction, d.PathApp, d.IconName, d.UserEntry, d.DateEntry, d.UserLastMaintenance, d.DateLastMaintenance, d.IDModuleFeatures, d.IDIcon, d.IDModule, d.IDFeatures }; return(Json(new { sEcho = sEcho, iTotalRecords = TotalRecords, iTotalDisplayRecords = TotalRecords, aaData = resultnya }, JsonRequestBehavior.AllowGet)); }
public ActionResult ModuleFeatureUpdateSequence(string IDModule, string IDFeature, string FeatureType, string direction) { string ret = ""; try { TFeatureModel mdl = new TFeatureModel(); mdl.IDModule = IDModule; mdl.IDFeatures = IDFeature; mdl.FeaturesType = FeatureType; Feature = new TFeatureClass(); ret = Feature.FeatureUpdateSequence(mdl, direction); return(Json(new { result = ret }, JsonRequestBehavior.AllowGet)); } catch (Exception err) { ret = "Err|" + err.Message; return(Json(new { result = ret }, JsonRequestBehavior.AllowGet)); } }