Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var City = T_CityService.LoadEntities(x => x.DelFlag == Delflag).DefaultIfEmpty();

            ViewBag.City = City;
            ViewBag.json = Json(new { rows = City }, JsonRequestBehavior.AllowGet);
            ViewBag.YYY  = T_YxPersonService.LoadEntities(x => x.DEL == 0).DefaultIfEmpty();
            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            var CityID     = UserInfo_CityService.LoadEntities(x => x.UserInfo_ID == LoginUser.ID).FirstOrDefault();
            var City       = T_CityService.LoadEntities(x => x.ID == CityID.T_City_ID).FirstOrDefault().T_Quyu.ToList();
            var Items      = T_ItemsService.LoadEntities(x => x.DelFlag == null).ToList();
            var ItemsCount = Items != null?Items.Distinct(new FastPropertyComparer <T_Items>("Bakstr")).ToList() : null;

            ViewBag.City       = City;
            ViewBag.Items      = Items;
            ViewBag.ItemsCount = ItemsCount.Count;
            return(View());
        }
Ejemplo n.º 3
0
        public ActionResult GetJson()
        {
            var City = T_CityService.LoadEntities(x => x.DelFlag == Delflag).DefaultIfEmpty();
            var temp = from u in City
                       select new
            {
                ID   = u.ID,
                city = u.City
            };

            return(Json(new { rows = temp }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
0
        //获取下拉城市列表
        public ActionResult GetCitylist()
        {
            var id    = Convert.ToInt64(Request["id"]);
            var tdata = T_CityService.LoadEntities(x => x.province_id == id).DefaultIfEmpty();

            if (tdata.ToList()[0] == null)
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }
            var temp = from a in tdata
                       select new {
                ID   = a.ID,
                City = a.City
            };

            return(Json(temp, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
        // 获取城市
        public ActionResult GetCity()
        {
            int pageIdex = Request["page"] != null?int.Parse(Request["page"]) : 1;

            int pageSize = Request["rows"] != null?int.Parse(Request["rows"]) : 35;

            int totalcount = int.MaxValue;
            var mydata     = T_CityService.LoadPageEntities(pageIdex, pageSize, out totalcount, x => x.DelFlag == 0, x => x.province_id, true);
            var temp       = from a in mydata
                             select new
            {
                ID   = a.ID,
                City = a.City,
                str  = a.T_province.str
            };

            return(Json(new { rows = temp, total = totalcount }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 6
0
        //删除城市
        public ActionResult delCity()
        {
            var id    = Convert.ToInt64(Request["IDs"]);
            var tdata = T_CityService.LoadEntities(x => x.ID == id).FirstOrDefault();

            if (tdata != null)
            {
                if (T_CityService.DeleteEntity(tdata))
                {
                    return(Json(new { ret = "ok" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { msg = "没有成功删除信息!" }, JsonRequestBehavior.AllowGet));
                }
            }
            return(Json(new { msg = "数据库中没有找到要删除的项目!" }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 7
0
 //添加城市
 public ActionResult AddCity(T_City tpe)
 {
     if (tpe.ID <= 0)
     {
         if (T_CityService.LoadEntities(x => x.City == tpe.City).FirstOrDefault() == null)
         {
             tpe.DelFlag = 0;
             T_CityService.AddEntity(tpe);
             return(Json(new { ret = "ok" }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { msg = "不可添加重复的城市!~", JsonRequestBehavior.AllowGet }));
         }
     }
     else
     {
         return(Json(new { msg = "添加出错,请联系管理员!~", JsonRequestBehavior.AllowGet }));
     }
 }
Ejemplo n.º 8
0
        public ActionResult Index()
        {
            var CityID     = UserInfo_CityService.LoadEntities(x => x.UserInfo_ID == LoginUser.ID).FirstOrDefault();
            var City       = T_CityService.LoadEntities(x => x.ID == CityID.T_City_ID).FirstOrDefault().T_Quyu.ToList();
            var Items      = T_ItemsService.LoadEntities(x => x.DelFlag == null).ToList();
            var ItemsCount = Items != null?Items.Distinct(new FastPropertyComparer <T_Items>("Bakstr")).ToList() : null;

            ViewBag.City       = City;
            ViewBag.Items      = Items;
            ViewBag.ItemsCount = ItemsCount.Count;
            var Itemsbool = T_BoolItemService.LoadEntities(x => x.str == "上传张数").FirstOrDefault();

            if (Itemsbool == null)
            {
                return(Content("no:数据库[T_BoolItem][str]列没有限制上传张数的数据属性,检查数据库完整性!"));
            }
            var imagecount = UserSaveImageService.LoadEntities(x => x.UserSaveID == LoginUser.ID).DefaultIfEmpty();

            ViewBag.imagecount = Itemsbool.@int;
            return(View());
        }
Ejemplo n.º 9
0
 public ActionResult GetMap()
 {
     ViewBag.Address = Request["Address"].ToString();
     ViewBag.City    = T_CityService.LoadEntities(x => x.ID == LoginUser.CityID).FirstOrDefault().City;
     return(View());
 }
Ejemplo n.º 10
0
 public ActionResult Index()
 {
     ViewBag.City      = T_CityService.LoadEntities(x => x.DelFlag == 0).DefaultIfEmpty().ToList();
     ViewBag.ZhuangXiu = T_ItemsService.LoadEntities(x => x.Icons == 3).ToList();
     return(View());
 }
Ejemplo n.º 11
0
 public ActionResult Index()
 {
     ViewBag.province = T_provinceService.LoadEntities(x => x.ID > 0).DefaultIfEmpty().ToList();
     ViewBag.City     = T_CityService.LoadEntities(x => x.DelFlag == 0).DefaultIfEmpty().ToList();
     return(View());
 }