示例#1
0
        public ActionResult Index()
        {
            BusinessCache businesscache = RemotingHelp.GetModelObject <BusinessCache>();

            ViewBag.Business = businesscache.GetBusiness().obj;
            return(View());
        }
示例#2
0
        public ActionResult GetUrl(string objectname)
        {
            UPLOAD upload = RemotingHelp.GetModelObject <UPLOAD>();
            var    result = upload.GetFilePath(objectname);

            return(Redirect(result.obj.ToString()));
        }
示例#3
0
        public ActionResult UpdateSku(string skuguid, int isdefaultprice, decimal price, int stock)
        {
            SKU sku = RemotingHelp.GetModelObject <SKU>();

            return(Json(sku.UpdateSku(skuguid, isdefaultprice, price, stock),
                        JsonRequestBehavior.AllowGet));
        }
示例#4
0
        public ActionResult SkuAddAttribute()
        {
            SKU sku = RemotingHelp.GetModelObject <SKU>();

            ViewBag.Attributes = sku.GetAttributeInfos();
            return(View());
        }
示例#5
0
        public ActionResult GetProductSKUInfoFromCache(int cateid, int pid)
        {
            ProductCache pcache   = RemotingHelp.GetModelObject <ProductCache>();
            var          skuinfos = pcache.GetProductInfoFromCache(cateid, pid).skuInfos;
            List <ShowSkuInfoForLayuiTable> list = new List <ShowSkuInfoForLayuiTable>();

            foreach (var skuinfo in skuinfos)
            {
                ShowSkuInfoForLayuiTable newitem = new ShowSkuInfoForLayuiTable()
                {
                    sku_guid                = skuinfo.sku_guid,
                    sku_input               = skuinfo.sku_input,
                    sku_isdefaultprice      = skuinfo.sku_isdefaultprice,
                    sku_isdefaultprice_text = skuinfo.sku_isdefaultprice == 0 ? "否" : "是",
                    sku_price               = skuinfo.sku_price,
                    sku_price_text          = skuinfo.sku_price == -1 ? "默认" : skuinfo.sku_price.ToString(),
                    sku_stock               = skuinfo.sku_stock,
                    sku_stock_text          = skuinfo.sku_stock == -1 ? "默认" : skuinfo.sku_stock.ToString()
                };
                list.Add(newitem);
            }
            return(Json(
                       new LayuiTableApiResult()
            {
                code = 0,
                msg = "",
                count = list.Count,
                data = list
            },
                       JsonRequestBehavior.AllowGet));
        }
示例#6
0
        public ActionResult Add()
        {
            COUPON coupon = RemotingHelp.GetModelObject <COUPON>();

            ViewBag.Coupons = coupon.GetRecpientCouponForGroup();
            return(View());
        }
示例#7
0
        public ActionResult BoxList()
        {
            BoxCache boxcache = RemotingHelp.GetModelObject <BoxCache>();

            ViewBag.boxlist = boxcache.GetBoxes();
            return(View());
        }
示例#8
0
        /// <summary>
        /// 商家同意退款
        /// </summary>
        /// <returns></returns>
        public ActionResult QueryRefund(int oid)
        {
            ORDER order = RemotingHelp.GetModelObject <ORDER>();

            return(Json(
                       order.QueryRefund(oid),
                       JsonRequestBehavior.AllowGet));
        }
示例#9
0
        /// <summary>
        /// 获取月统计数据
        /// </summary>
        /// <returns></returns>
        public ActionResult GetMonthStatistics()
        {
            ORDER order = RemotingHelp.GetModelObject <ORDER>();

            return(Json(
                       order.GetMonthStatistics(),
                       JsonRequestBehavior.AllowGet));
        }
示例#10
0
        public ActionResult Deleteproduct(int pid)
        {
            PRODUCT product = RemotingHelp.GetModelObject <PRODUCT>();

            return(Json(
                       product.Deleteproduct(pid),
                       JsonRequestBehavior.AllowGet));
        }
示例#11
0
        public ActionResult GetAttributeValueInfos(int attrid)
        {
            SKU sku = RemotingHelp.GetModelObject <SKU>();

            return(Json(
                       sku.GetAttributeValueInfos(attrid),
                       JsonRequestBehavior.AllowGet));
        }
示例#12
0
        public ActionResult UpdatePorduct(AddProductModel model)
        {
            PRODUCT product = RemotingHelp.GetModelObject <PRODUCT>();

            return(Json(
                       product.UpdatePorduct(model),
                       JsonRequestBehavior.AllowGet));
        }
示例#13
0
        /// <summary>
        /// 修改商品分类信息
        /// </summary>
        /// <param name="cateid"></param>
        /// <param name="name"></param>
        /// <param name="displayorder"></param>
        /// <returns></returns>
        public ActionResult UpdateCateGory(int cateid, string name, int displayorder)
        {
            PRODUCT product = RemotingHelp.GetModelObject <PRODUCT>();

            return(Json(
                       product.UpdateCateGory(cateid, name, displayorder),
                       JsonRequestBehavior.AllowGet));
        }
示例#14
0
        /// <summary>
        /// 批量删除分类
        /// </summary>
        /// <param name="cateids"></param>
        /// <returns></returns>
        public ActionResult DeleteCateGories(int[] cateids)
        {
            PRODUCT product = RemotingHelp.GetModelObject <PRODUCT>();

            return(Json(
                       product.DeleteCateGories(cateids),
                       JsonRequestBehavior.AllowGet));
        }
示例#15
0
        /// <summary>
        /// 修改堂食订单为已使用
        /// </summary>
        /// <returns></returns>
        public ActionResult UseShopOder(int oid)
        {
            ORDER order = RemotingHelp.GetModelObject <ORDER>();

            return(Json(
                       order.UseShopOder(oid),
                       JsonRequestBehavior.AllowGet));
        }
示例#16
0
        /// <summary>
        /// 添加分类
        /// </summary>
        /// <returns></returns>
        public ActionResult AddCateGory(string name, int displayorder = 0)
        {
            PRODUCT product = RemotingHelp.GetModelObject <PRODUCT>();

            return(Json(
                       product.AddCateGory(name, displayorder),
                       JsonRequestBehavior.AllowGet));
        }
示例#17
0
        public string PayNotify()
        {
            String xmlData = getPostStr();
            //保存付款成功过来的数据
            ORDER order = RemotingHelp.GetModelObject <ORDER>();

            return(order.PayNotify(xmlData));
        }
示例#18
0
        public ActionResult Detail(int groupinfoid)
        {
            GROUP group     = RemotingHelp.GetModelObject <GROUP>();
            var   groupList = group.GroupInfoListForAdmin().data as List <GroupInfoModel>;

            ViewBag.GroupInfo = groupList.SingleOrDefault(t => t.groupinfoid == groupinfoid);
            return(View());
        }
示例#19
0
        public ActionResult DeleteBox(int boxid)
        {
            BOX box = RemotingHelp.GetModelObject <BOX>();

            return(Json(
                       box.DeleteBox(boxid),
                       JsonRequestBehavior.AllowGet
                       ));
        }
示例#20
0
        public ActionResult AddBox(string code, string name, decimal price, decimal bookprice, int type)
        {
            BOX box = RemotingHelp.GetModelObject <BOX>();

            return(Json(
                       box.AddBox(code, name, price, bookprice, type),
                       JsonRequestBehavior.AllowGet
                       ));
        }
示例#21
0
        public ActionResult UpdateBox(int boxid, BoxState state, string name, decimal price, decimal bookprice)
        {
            BOX box = RemotingHelp.GetModelObject <BOX>();

            return(Json(
                       box.UpdateBox(boxid, state, name, price, bookprice),
                       JsonRequestBehavior.AllowGet
                       ));
        }
示例#22
0
        /// <summary>
        /// 获取包厢列表
        /// </summary>
        /// <returns></returns>
        public ActionResult GetBoxes()
        {
            BoxCache boxcache = RemotingHelp.GetModelObject <BoxCache>();

            return(Json(
                       boxcache.GetBoxes(),
                       JsonRequestBehavior.AllowGet
                       ));
        }
示例#23
0
        public ActionResult Base64Str(string base64str)
        {
            MemoryStream     stream           = new MemoryStream(Convert.FromBase64String(base64str.Split(',')[1]));
            StreamFileHelper streamFileHelper = new StreamFileHelper();
            UPLOAD           upload           = RemotingHelp.GetModelObject <UPLOAD>();

            return(Json(upload.Upload(streamFileHelper.StreamToBytes(stream), DateTime.Now.Millisecond.ToString() + ".png", "webadmin"),
                        JsonRequestBehavior.AllowGet));
        }
示例#24
0
        /// <summary>
        /// 订单列表页
        /// </summary>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="orderState"></param>
        /// <returns></returns>
        //public ActionResult ListOrder(DateTime startTime, DateTime endTime,int page,int count)
        //{
        //    var sTime = startTime.ToString("yyyy-MM-dd HH:mm:ss");
        //    var eTime = endTime.ToString("yyyy-MM-dd HH:mm:ss");
        //    ORDER order = RemotingHelp.GetModelObject<ORDER>();
        //    var sqlWhere = $@" AND bsp_orders.addtime between '{sTime}' AND '{eTime}'";
        //    var list = order.GetOrderList(sqlWhere, page, count);
        //    ViewBag.OrderList = list;
        //    ViewBag.page = page;
        //    return PartialView();
        //}

        /// <summary>
        /// 销售统计
        /// </summary>
        /// <returns></returns>
        public ActionResult Statistics()
        {
            ORDER order = RemotingHelp.GetModelObject <ORDER>();

            ViewBag.TodayStat = order.GetDayStatistics();
            ViewBag.WeekStat  = order.GetWeekStatistics();
            ViewBag.MonthStat = order.GetMonthStatistics();
            return(View());
        }
示例#25
0
 public ActionResult ProductTypeAdd(int cateid = 0)
 {
     ViewBag.cateid = cateid;
     ViewBag.cate   = null;
     if (cateid > 0)
     {
         PRODUCT product = RemotingHelp.GetModelObject <PRODUCT>();
         ViewBag.cate = product.GetCategories().Where(t => t.cateid == cateid).SingleOrDefault();
     }
     return(View());
 }
示例#26
0
        public ActionResult File()
        {
            var file   = Request.Files["file"];
            var name   = file.FileName;
            var stream = file.InputStream;
            StreamFileHelper streamFileHelper = new StreamFileHelper();
            UPLOAD           upload           = RemotingHelp.GetModelObject <UPLOAD>();

            return(Json(upload.Upload(streamFileHelper.StreamToBytes(stream), name, "webadmin"),
                        JsonRequestBehavior.AllowGet));
        }
示例#27
0
        public ActionResult Product(int cateid = 0, int isonsale = -1)
        {
            ProductCache pcache = RemotingHelp.GetModelObject <ProductCache>();

            ViewBag.productList = pcache.GetProductList(cateid, isonsale);
            ViewBag.cateid      = cateid;
            PRODUCT product = RemotingHelp.GetModelObject <PRODUCT>();

            ViewBag.cates    = product.GetCategories();
            ViewBag.isonsale = isonsale;
            return(View());
        }
示例#28
0
        public ActionResult BannerAdd(int bannerid = 0)
        {
            ViewBag.bannerid = bannerid;
            if (bannerid > 0)
            {
                BannerCache bannerCache = RemotingHelp.GetModelObject <BannerCache>();
                ViewBag.banner = bannerCache.GetBanners().SingleOrDefault(t => t.id == bannerid);
            }
            ProductCache productCache = RemotingHelp.GetModelObject <ProductCache>();

            ViewBag.products = productCache.GetNoRepeatProducts();
            return(View());
        }
示例#29
0
        /// <summary>
        /// 添加编辑属性值
        /// </summary>
        /// <returns></returns>
        public ActionResult SkuAddValue(int attrid, string attributename, int valueid = 0, string value = "", string price = "-1", string stock = "-1")
        {
            SKU sku = RemotingHelp.GetModelObject <SKU>();

            ViewBag.attrid        = attrid;
            ViewBag.attributename = attributename;
            ViewBag.value         = value;
            ViewBag.price         = price;
            ViewBag.stock         = stock;
            ViewBag.valueid       = valueid;
            ViewBag.values        = sku.GetAttributeValueInfos(attrid);
            return(View());
        }
示例#30
0
        public ActionResult CouponAdd(int coupontypeid = 0)
        {
            ViewBag.coupontypeid = coupontypeid;
            ViewBag.coupontype   = null;
            if (coupontypeid > 0)
            {
                COUPON coupon = RemotingHelp.GetModelObject <COUPON>();
                ViewBag.coupontype = (coupon.GetCouponType().data as List <ShowCouponTypeInfo>).SingleOrDefault(t => t.ct_coupontypeid == coupontypeid);
            }
            ProductCache productCache = RemotingHelp.GetModelObject <ProductCache>();

            ViewBag.products = productCache.GetNoRepeatProducts();
            return(View());
        }