Esempio n. 1
0
        public BProperty GetProperty()
        {
            BProperty property = new BProperty();
            string user_id = User.Identity.Name;
            UserManager userMgr = new UserManager(int.Parse(user_id), null);
            BUser user = userMgr.CurrentUser;
            Shop MainShop = userMgr.Main_Shop;
            ShopCategoryManager cateMgr = new ShopCategoryManager(userMgr.CurrentUser, MainShop, userMgr.CurrentUserPermission);
            HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"];
            HttpRequestBase request = context.Request;
            int propId = 0;
            int.TryParse(request["prop_id"],out propId);
            List<BProperty> properties = cateMgr.GetProperties(0,propId);
            if (properties.Count == 1)
            {
                property = properties[0];
            }

            return property;
        }
Esempio n. 2
0
 public List<BProperty> GetProperties(int categoryId)
 {
     string user_id = User.Identity.Name;
     UserManager userMgr = new UserManager(int.Parse(user_id), null);
     BUser user = userMgr.CurrentUser;
     Shop MainShop = userMgr.Main_Shop;
     ShopCategoryManager cateMgr = new ShopCategoryManager(userMgr.CurrentUser, MainShop, userMgr.CurrentUserPermission);
     List<BProperty> properties = cateMgr.GetProperties(categoryId);
     return properties;
 }
Esempio n. 3
0
 public PQGridData GetPropertiesT()
 {
     string user_id = User.Identity.Name;
     UserManager userMgr = new UserManager(int.Parse(user_id), null);
     ApiMessage message = new ApiMessage();
     BUser user = userMgr.CurrentUser;
     ShopCategoryManager cateMgr = new ShopCategoryManager(userMgr.CurrentUser, userMgr.Shop, userMgr.CurrentUserPermission);
     int categoryId = 0;
     HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"];
     HttpRequestBase request = context.Request;
     int.TryParse(request["cid"], out categoryId);
     string sortBy = "";
     string dir = "";
     if (request["sortBy"] != null)
     {
         sortBy = request["sortBy"];
     }
     if (request["dir"] != null)
     {
         sortBy = request["dir"];
     }
     List<BProperty> properties = cateMgr.GetProperties(categoryId,0,sortBy,dir);
     PQGridData grid = new PQGridData();
     grid.curPage = 1;
     grid.totalRecords = properties.Count;
     grid.data = properties;
     message.Item = grid;
     message.Status="ok";
     return grid;
 }
Esempio n. 4
0
 public ActionResult Properties()
 {
     string user_id = HttpContext.User.Identity.Name;
     UserManager userMgr = new UserManager(int.Parse(user_id), null);
     BUser user = userMgr.CurrentUser;
     Shop MainShop = userMgr.Main_Shop;
     ShopCategoryManager cateMgr = new ShopCategoryManager(userMgr.CurrentUser, MainShop, userMgr.CurrentUserPermission);
     List<BCategory> categories = cateMgr.GetCategories(0);
     List<BProperty> properties = cateMgr.GetProperties(0);
     ViewData["category"] = categories;
     ViewData["mproperty"] = properties;
     return View();
 }