Esempio n. 1
0
        public IQueryable <District> FindBy(System.Linq.Expressions.Expression <Func <District, bool> > predicate)
        {
            DistrictDAL           dalObject = new DistrictDAL();
            IQueryable <District> results   = dalObject.FindBy(predicate);

            return(results);
        }
Esempio n. 2
0
        /// <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));
        }
Esempio n. 3
0
        public IQueryable <District> GetAll()
        {
            DistrictDAL           dalObject = new DistrictDAL();
            IQueryable <District> results   = dalObject.GetAll();

            return(results);
        }
Esempio n. 4
0
        public ActionResult EditDistrict(DistrictViewModel model)
        {
            DistrictDAL sgdal = new DistrictDAL();

            sgdal.Update(model.CastDB(model));
            sgdal.AcceptAllChange();
            return(GetBaseResponse <DistrictViewModel>(true));
        }
Esempio n. 5
0
        /// <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));
        }
Esempio n. 6
0
        public ActionResult DeleteDistrict(string id)
        {
            DistrictDAL sgdal = new DistrictDAL();
            var         model = sgdal.Get(id);

            sgdal.Delete(model);
            sgdal.AcceptAllChange();
            return(GetBaseResponse <DistrictViewModel>(true));
        }
Esempio n. 7
0
        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));
        }
Esempio n. 8
0
        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));
        }
Esempio n. 9
0
        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);
        }
Esempio n. 10
0
        /// <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);
        }
Esempio n. 11
0
        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));
        }
Esempio n. 12
0
        public void Edit(District entity)
        {
            DistrictDAL dalObject = new DistrictDAL();

            dalObject.Edit(entity);
        }
Esempio n. 13
0
        public void Add(District entity)
        {
            DistrictDAL dalObject = new DistrictDAL();

            dalObject.Add(entity);
        }
Esempio n. 14
0
        /// <summary>
        /// To Get All Districts
        /// </summary>
        /// <returns></returns>
        public DistrictList GetAllDistricts()
        {
            DistrictDAL objDisDAL = new DistrictDAL();

            return(objDisDAL.GetAllDistricts());
        }
Esempio n. 15
0
 public DistrictController()
 {
     districtDAL = new DistrictDAL(DbProvider);
 }
Esempio n. 16
0
        public void Delete(int id)
        {
            DistrictDAL dalObject = new DistrictDAL();

            dalObject.Delete(id);
        }
Esempio n. 17
0
 public JsonResult GetDistrict(int regionId)
 {
     return Json(DistrictDAL.GetDataByRegionId(regionId),
         JsonRequestBehavior.AllowGet);
 }
Esempio n. 18
0
 public DistrictBL(DistrictDAL districtDAL)
 {
     _districtDAL = districtDAL;
 }