public IQueryable <District> FindBy(System.Linq.Expressions.Expression <Func <District, bool> > predicate) { DistrictDAL dalObject = new DistrictDAL(); IQueryable <District> results = dalObject.FindBy(predicate); return(results); }
/// <summary> /// 地区视图 /// </summary> /// <returns></returns> public ActionResult DistrictIndex() { DistrictDAL sgdal = new DistrictDAL(); var sglist = sgdal.GetAll().ToList().Select(t => new DistrictViewModel().CastModel(t)); return(View(sglist)); }
public IQueryable <District> GetAll() { DistrictDAL dalObject = new DistrictDAL(); IQueryable <District> results = dalObject.GetAll(); return(results); }
public ActionResult EditDistrict(DistrictViewModel model) { DistrictDAL sgdal = new DistrictDAL(); sgdal.Update(model.CastDB(model)); sgdal.AcceptAllChange(); return(GetBaseResponse <DistrictViewModel>(true)); }
/// <summary> /// 修改地区 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult EditDistrict(string id) { DistrictDAL sgdal = new DistrictDAL(); var model = new DistrictViewModel(); model = model.CastModel(sgdal.Get(id)); return(View(model)); }
public ActionResult DeleteDistrict(string id) { DistrictDAL sgdal = new DistrictDAL(); var model = sgdal.Get(id); sgdal.Delete(model); sgdal.AcceptAllChange(); return(GetBaseResponse <DistrictViewModel>(true)); }
public ActionResult CreateDistrict(DistrictViewModel model) { DistrictDAL sgdal = new DistrictDAL(); model.ID = Guid.NewGuid().ToString(); sgdal.Add(model.CastDB(model)); sgdal.AcceptAllChange(); return(GetBaseResponse <DistrictViewModel>(true)); }
public ActionResult GetDistrict() { DistrictDAL sgdal = new DistrictDAL(); var sglist = sgdal.GetAll().Select(x => new { x.ID, x.Name }).ToList(); BaseResponse <object> br = new BaseResponse <object>(); br.Status = "Success"; br.Data = sglist; return(Json(br, JsonRequestBehavior.AllowGet)); }
public IEnumerable <SelectListItem> DistrictList(string id) { DistrictDAL dal = new DistrictDAL(); var viewList = new List <SelectListItem>(); var list = dal.GetAll(); foreach (var vi in list) { SelectListItem se = new SelectListItem(); se.Text = vi.Name; se.Value = vi.ID.ToString(); if (id == vi.ID) { se.Selected = true;; } viewList.Add(se); } return(viewList); }
/// <summary> /// 递归查父ID /// </summary> /// <param name="DistId"></param> /// <returns></returns> public static string get_parentids(int DistId) { string result = ""; if (DistId > 0) { int parentid = new DistrictDAL().get_parentid(DistId); if (parentid > 0) { result = result + "," + parentid; string pid = get_parentids(parentid); if (pid.Trim().Length > 0) { result = result + pid; } } } if (result.Trim().Length > 0 && !result.EndsWith(",")) { result = result + ","; } return(result); }
public ActionResult DatapermissionList(string roleid) { List <CheckBoxListModel> list = new List <CheckBoxListModel>(); DistrictDAL dtdal = new DistrictDAL(); SalesGroupDAL sgdal = new SalesGroupDAL(); DictionaryDAL dicdal = new DictionaryDAL(); DataPermissionDAL ddal = new DataPermissionDAL(); var dpuer = ddal.GetAll().Where(t => t.RoleID == roleid).Select(t => t.DataPermissionID); var dataplist = dtdal.GetAll().Select(t => new { t.ID, t.Name }) .Union(dicdal.GetAll(t => t.ParentKey == "-ThirdPlatform").Select(t => new { ID = t.Path, Name = t.Text })) .Union(sgdal.GetAll().Select(t => new { t.ID, t.Name })); foreach (var t in dataplist) { list.Add(new CheckBoxListModel(t.ID, t.Name, dpuer.Contains(t.ID))); } //为数据权限增加 自有资金 list.Add(new CheckBoxListModel(CaseMode.ZiYouZiJin, "自有资金", dpuer.Contains(CaseMode.ZiYouZiJin))); //为数据权限增加 未选择 list.Add(new CheckBoxListModel(CaseMode.WeiXuanZe, "未选择案件模式", dpuer.Contains(CaseMode.WeiXuanZe))); return(View(list)); }
public void Edit(District entity) { DistrictDAL dalObject = new DistrictDAL(); dalObject.Edit(entity); }
public void Add(District entity) { DistrictDAL dalObject = new DistrictDAL(); dalObject.Add(entity); }
/// <summary> /// To Get All Districts /// </summary> /// <returns></returns> public DistrictList GetAllDistricts() { DistrictDAL objDisDAL = new DistrictDAL(); return(objDisDAL.GetAllDistricts()); }
public DistrictController() { districtDAL = new DistrictDAL(DbProvider); }
public void Delete(int id) { DistrictDAL dalObject = new DistrictDAL(); dalObject.Delete(id); }
public JsonResult GetDistrict(int regionId) { return Json(DistrictDAL.GetDataByRegionId(regionId), JsonRequestBehavior.AllowGet); }
public DistrictBL(DistrictDAL districtDAL) { _districtDAL = districtDAL; }