public JsonResult GetRoot(int id) { var items = new PositionRateRepository().GetTreeAll(id); return(new JsonResult { Data = items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public ActionResult PositionRateDetail(int?id, int?type) { var model = new PositionRateRepository().GetByID(id); ViewBag.Division = DropDownList.GetDivision(model != null ? model.DivID : null, false); ViewBag.Department = DropDownList.GetDepartment(model != null ? model.DivID : null, model != null ? model.DepID: null, false); ViewBag.Section = DropDownList.GetSection(model != null ? model.DivID : null, model != null ? model.DepID: null, model != null ? model.SecID: null, false); ViewBag.Position = DropDownList.GetPosition(model != null ? model.PoID : null, type, false); ViewBag.Education = DropDownList.GetEducation(model != null ? model.EduID : null, true); ViewBag.TypeID = type; return(PartialView("_PositionRate", model)); }
public JsonResult SavePositionRate(PositionRateViewModel data) { ResponseData result = new Models.ResponseData(); if (data.MpID != 0) { result = new PositionRateRepository().UpdateByEntity(data); } else { result = new PositionRateRepository().AddByEntity(data); } return(Json(result, JsonRequestBehavior.AllowGet)); }
public JsonResult GetChildren(string parenttype, int usertype, int?divid, int?depid, int?secid, int?poid) { List <TreeViewModel> items = new PositionRateRepository().GetTree(parenttype, usertype, divid, depid, secid, poid); return(new JsonResult { Data = items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); //var g1 = Guid.NewGuid().ToString(); //var g2 = Guid.NewGuid().ToString(); //var items = new[] //{ // new { id = "child-" + g1, text = "Child " + g1, children = true }, // new { id = "child-" + g2, text = "Child " + g2, children = true } //} //.ToList(); }
public JsonResult GetDetailByMp(int mpid) { var result = new PositionRateRepository().GetDetailByMp(mpid); return(Json(result, JsonRequestBehavior.AllowGet)); }