/// <summary>
        /// 获取商品列表总数
        /// </summary>
        /// <param name="GName">商品名称</param>
        /// <param name="CId">类目ID</param>
        /// <param name="PCId">一级类目ID</param>
        /// <param name="isSelect">是否选购:0:未选购,1:已选购</param>
        /// <returns></returns>
        public JsonResult GetAllCount(string GName = "", int CId = 0, int PCId = 0, int IsSelect = 0)
        {
            int           cgid = 0;
            GoodsBasicBll bll  = new GoodsBasicBll();

            return(Json(bll.GetAllCountByAgent(GName, CId, PCId, AgentLoginUser.UserBasic.EnterpriseID, AgentLoginUser.RoleID, IsSelect, cgid), JsonRequestBehavior.AllowGet));
        }
 /// <summary>
 /// 获取商品列表
 /// </summary>
 /// <param name="GName">商品名称</param>
 /// <param name="CId">类目ID</param>
 /// <param name="PCId">一级类目ID</param>
 /// <param name="isSelect">是否选购:0:未选购,1:已选购</param>
 /// <param name="PageIndex">页码(从1开始)</param>
 /// <param name="PageSize">每页大小</param>
 /// <returns></returns>
 public JsonResult GetList(string GName = "", int CId = 0, int PCId = 0, int IsSelect = 0, int PageIndex = 1, int PageSize = 10)
 {
     int cgid = 0;
     if (PageIndex == 0) PageIndex = 1;
     GoodsBasicBll bll = new GoodsBasicBll();
     return Json(bll.GetGBListByAgent(GName, CId, PCId, AgentLoginUser.UserBasic.EnterpriseID, AgentLoginUser.RoleID, IsSelect, cgid, PageIndex, PageSize), JsonRequestBehavior.AllowGet);
 }
        public JsonResult UpdateIsSale(int isSale, string gbids)
        {
            string[]      gbid = gbids.Split(',');
            GoodsBasicBll bll  = new GoodsBasicBll();

            return(Json(bll.UpdateIsSale(isSale, gbid), JsonRequestBehavior.AllowGet));
        }
Exemple #4
0
 public ActionResult Details(int goodsId = 0)
 {
     GoodsBasicBll bll = new GoodsBasicBll();
     int gcPid = 0;
     var goods = bll.GetModelByGBid(goodsId, out gcPid);
     AttributesBll objAttributesBll = new AttributesBll();
     ViewBag.AttrValue = objAttributesBll.GetListByGBid(goodsId, goods.EnterpriseID);
     return View(goods);
 }
        public JsonResult GetList(string GName = "", int PCid = 0, int CId = 0, int IsStatus = 0, int GId = 0, int IsSales = 0, int PageIndex = 1, int PageSize = 10)
        {
            if (PageIndex == 0)
            {
                PageIndex = 1;
            }
            GoodsBasicBll bll = new GoodsBasicBll();

            return(Json(bll.GetGBList(GName, CId, PCid, IsStatus, LoginUser.UserBasic.EnterpriseID, GId, IsSales, PageIndex, PageSize), JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// 选择商品页的分页数据
        /// </summary>
        /// <param name="GoodsBasicIDs"></param>
        /// <param name="name"></param>
        /// <param name="GoodsClassFirst"></param>
        /// <param name="GoodsClassSecond"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="groupId"></param>
        /// <returns></returns>
        public ActionResult AutoGoodsBasicPage(string GoodsBasicIDs = "", string name = "", int GoodsClassFirst = -1, int GoodsClassSecond = -1, int pageIndex = 1, int pageSize = 5, int groupId = -1)
        {
            GoodsBasicBll bll   = new GoodsBasicBll();
            long          Total = 0;
            var           list  = bll.GetGoodsBasicList(ref Total, GoodsBasicIDs, name, GoodsClassFirst, GoodsClassSecond, pageIndex, pageSize, groupId, LoginUser.UserBasic.EnterpriseID);

            ViewBag.Total = Total;
            ViewBag.List  = list;
            return(PartialView());
        }
        /// <summary>
        /// 获取商品列表
        /// </summary>
        /// <param name="GName">商品名称</param>
        /// <param name="CId">类目ID</param>
        /// <param name="PCId">一级类目ID</param>
        /// <param name="isSelect">是否选购:0:未选购,1:已选购</param>
        /// <param name="PageIndex">页码(从1开始)</param>
        /// <param name="PageSize">每页大小</param>
        /// <returns></returns>
        public JsonResult GetList(string GName = "", int CId = 0, int PCId = 0, int IsSelect = 0, int PageIndex = 1, int PageSize = 10)
        {
            int cgid = 0;

            if (PageIndex == 0)
            {
                PageIndex = 1;
            }
            GoodsBasicBll bll = new GoodsBasicBll();

            return(Json(bll.GetGBListByAgent(GName, CId, PCId, AgentLoginUser.UserBasic.EnterpriseID, AgentLoginUser.RoleID, IsSelect, cgid, PageIndex, PageSize), JsonRequestBehavior.AllowGet));
        }
        public ActionResult Operate(int id = 0)
        {
            ViewBag.gbId = id;
            //价格区间
            ViewBag.isPrice    = LoginUser.UserBasic.Enterprise.ISPrice;
            ViewBag.priceLower = LoginUser.UserBasic.Enterprise.PriceLower;
            ViewBag.priceUpper = LoginUser.UserBasic.Enterprise.PriceUpper;
            GoodsBasicBll bll   = new GoodsBasicBll();
            GoodsGroupBll ggBll = new GoodsGroupBll();
            GoodsBasic    list  = new GoodsBasic();

            ViewBag.gAttr  = new List <Hashtable>();
            ViewBag.pClass = 0;
            int gclassP;

            if (id != 0)
            {
                list           = bll.GetModelByGBid(id, out gclassP, LoginUser.UserBasic.EnterpriseID);
                ViewBag.pClass = gclassP;
                if (list != null)
                {
                    //商品属性
                    AttributesBll gavBll = new AttributesBll();
                    ViewBag.gAttr = gavBll.GetListByGBid(id);
                    ////商品销售卖点
                    //SellPointBll spBll = new SellPointBll();
                    //list.SellPointList = spBll.GetListByGBid(id);
                    //商品可视分组
                    list.GoodsGroupList = ggBll.GetListByGBid(id);
                }
                else
                {
                    Response.Redirect("/Login/Index");
                    return(Content("此商品不存在"));
                }
            }
            //有货状态
            SelectLists sList = new SelectLists();

            ViewBag.ISNormal = new SelectList(sList.GetGBISNormal(), "value", "text", list.ISNormal);
            //价格模式
            ViewBag.RType = new SelectList(sList.GetGBRType(), "value", "text", list.RType);
            //可视分组
            ViewBag.gGroupList = ggBll.GetGGList(LoginUser.UserBasic.EnterpriseID);
            //所属品牌
            BrandBll bBll = new BrandBll();

            ViewBag.BrandID = new SelectList(bBll.GetEBList(LoginUser.UserBasic.EnterpriseID), "ID", "BName", list.BrandID);
            return(View(list));
        }
        /// <summary>
        /// 修改单个商品
        /// </summary>
        /// <param name="gaid"></param>
        /// <param name="ptype"></param>
        /// <param name="price"></param>
        /// <param name="pMin"></param>
        /// <param name="pMax"></param>
        /// <returns></returns>
        public ActionResult EditGoodsAgent(long gaid)
        {
            GoodsAgentBll gabll  = new GoodsAgentBll();
            var           ga     = gabll.GetArray(w => w.ID == gaid, x => new { x.GoodsBasicID, x.Price, x.RType });
            GoodsBasicBll bll    = new GoodsBasicBll();
            var           gb     = bll.GetArray(w => w.ID == ga[0].GoodsBasicID, x => new { x.MaxPrice, x.MinPrice });
            GCSnapshotBll gcsbll = new GCSnapshotBll();
            var           ges    = gcsbll.GetArray(w => w.GoodsAgentID == gaid && w.Status == 0, x => new { x.AContent });

            ViewBag.gaid    = gaid;
            ViewBag.ptype   = ga[0].RType;
            ViewBag.price   = ga[0].Price;
            ViewBag.pMin    = gb[0].MinPrice;
            ViewBag.pMax    = gb[0].MaxPrice;
            ViewBag.content = (ges.Count() < 1) ? "" : ges[0].AContent;
            return(View());
        }
 public ActionResult Operate(int id = 0)
 {
     ViewBag.gbId = id;
     //价格区间
     ViewBag.isPrice = LoginUser.UserBasic.Enterprise.ISPrice;
     ViewBag.priceLower = LoginUser.UserBasic.Enterprise.PriceLower;
     ViewBag.priceUpper = LoginUser.UserBasic.Enterprise.PriceUpper;
     GoodsBasicBll bll = new GoodsBasicBll();
     GoodsGroupBll ggBll = new GoodsGroupBll();
     GoodsBasic list = new GoodsBasic();
     ViewBag.gAttr = new List<Hashtable>();
     ViewBag.pClass = 0;
     int gclassP;
     if (id != 0)
     {
         list = bll.GetModelByGBid(id, out gclassP, LoginUser.UserBasic.EnterpriseID);
         ViewBag.pClass = gclassP;
         if (list != null)
         {
             //商品属性
             AttributesBll gavBll = new AttributesBll();
             ViewBag.gAttr = gavBll.GetListByGBid(id);
             ////商品销售卖点
             //SellPointBll spBll = new SellPointBll();
             //list.SellPointList = spBll.GetListByGBid(id);
             //商品可视分组
             list.GoodsGroupList = ggBll.GetListByGBid(id);
         }
         else
         {
             Response.Redirect("/Login/Index");
             return Content("此商品不存在");
         }
     }
     //有货状态
     SelectLists sList = new SelectLists();
     ViewBag.ISNormal = new SelectList(sList.GetGBISNormal(), "value", "text", list.ISNormal);
     //价格模式
     ViewBag.RType = new SelectList(sList.GetGBRType(), "value", "text", list.RType);
     //可视分组
     ViewBag.gGroupList = ggBll.GetGGList(LoginUser.UserBasic.EnterpriseID);
     //所属品牌
     BrandBll bBll = new BrandBll();
     ViewBag.BrandID = new SelectList(bBll.GetEBList(LoginUser.UserBasic.EnterpriseID), "ID", "BName", list.BrandID);
     return View(list);
 }
Exemple #11
0
        // GET: GoodsInfo
        public ActionResult Index(int id = 0)
        {
            GoodsBasicBll bll = new GoodsBasicBll();
            int gcPid = 0;
            var goods = bll.GetModelByGBid(id,out gcPid);

            //累计评价总数 要正常状态的 要对应商品企业的
            CommentsBll objCommentsBll = new CommentsBll();
            ViewBag.FeedbackNum = objCommentsBll.GetQueryCount(x => x.GoodsBasicID == id && x.Status == 0 && x.EnterpriseID == goods.EnterpriseID);
            //老客户回访总数 要对应商品企业的
            ReturnVisitBll objReturnVisitBll = new ReturnVisitBll();
            ViewBag.ReturnVisitNum = objReturnVisitBll.GetCountForGoodsInfo(id, goods.EnterpriseID);
            //销售卖点总数 要对应商品企业的
            SPJoinGBBll objSPJoinGBBll = new SPJoinGBBll();
            ViewBag.SellPointNum = objSPJoinGBBll.GetCountForGoodsInfo(id, goods.EnterpriseID);
            return View(goods);
        }
Exemple #12
0
        /// <summary>
        /// 选择商品页的总数
        /// </summary>
        /// <param name="GoodsBasicIDs"></param>
        /// <param name="name"></param>
        /// <param name="GoodsClassFirst"></param>
        /// <param name="GoodsClassSecond"></param>
        /// <param name="groupId"></param>
        /// <returns></returns>
        public long GetAutoGoodsBasicTotal(string GoodsBasicIDs = "", string name = "", int GoodsClassFirst = -1, int GoodsClassSecond = -1, int groupId = -1)
        {
            GoodsBasicBll bll = new GoodsBasicBll();

            return(bll.GetListCount(GoodsBasicIDs, name, GoodsClassFirst, GoodsClassSecond, groupId, LoginUser.UserBasic.EnterpriseID));
        }
Exemple #13
0
        public JsonResult UpdateSorting(long sorting, long nextSorting)
        {
            GoodsBasicBll bll = new GoodsBasicBll();

            return(Json(bll.UpdateSorting(sorting, nextSorting), JsonRequestBehavior.AllowGet));
        }
 public JsonResult UpdateIsSale(int isSale, string gbids)
 {
     string[] gbid = gbids.Split(',');
     GoodsBasicBll bll = new GoodsBasicBll();
     return Json(bll.UpdateIsSale(isSale, gbid), JsonRequestBehavior.AllowGet);
 }
 public JsonResult UpdateSorting(long sorting, long nextSorting)
 {
     GoodsBasicBll bll = new GoodsBasicBll();
     return Json(bll.UpdateSorting(sorting, nextSorting), JsonRequestBehavior.AllowGet);
 }
Exemple #16
0
        public JsonResult GetAllCount(string GName = "", int PCid = 0, int CId = 0, int IsStatus = 0, int GId = 0, int IsSales = 0)
        {
            GoodsBasicBll bll = new GoodsBasicBll();

            return(Json(bll.GetAllCount(GName, CId, PCid, IsStatus, LoginUser.UserBasic.EnterpriseID, GId, IsSales), JsonRequestBehavior.AllowGet));
        }
Exemple #17
0
        public ActionResult OperateSave(Model.GoodsBasic model)
        {
            GESnapshotBll geBll = new GESnapshotBll();
            GESnapshot    ges   = geBll.GetGesModel(model.ID, model.GESnapshot.GName);

            if (ges == null)
            {
                string        isSale = "";
                GoodsBasicBll bll    = new GoodsBasicBll();
                //可视分组
                string hidGG = Request["hidGG"];
                //属性规格
                string  hidGAV = HttpUtility.HtmlDecode(Request["hidGAV"]);
                int     gcPid  = int.Parse(Request["gClassP"]);
                int     gcid   = int.Parse(Request["gClass"]);
                Decimal lowerP = Decimal.Parse(Request["txtPriceLower"]);
                Decimal upperP = Decimal.Parse(Request["txtPriceUpper"]);
                string  GEImg  = Request["hidGEImg"];
                model.GoodsClassID = gcid;
                if (model.RType == 2)
                {
                    model.MinPrice = 0;
                    model.MaxPrice = 0;
                }
                else
                {
                    model.MinPrice = lowerP;
                    model.MaxPrice = upperP;
                }
                model.BarCode    = (model.BarCode == null) ? "" : model.BarCode;
                model.GModel     = (model.GModel == null) ? "" : model.GModel;
                model.SaleNum    = (model.SaleNum == null) ? 0 : model.SaleNum;
                model.CommentNum = (model.CommentNum == null) ? 0 : model.CommentNum;
                List <Hashtable> strGAV = JsonConvert.DeserializeObject <List <Hashtable> >(hidGAV);
                if (model.ID == 0)
                {
                    isSale               = "1";
                    model.IsSale         = 1;
                    model.Status         = 0;
                    model.EnterpriseID   = LoginUser.UserBasic.EnterpriseID;
                    model.AddTime        = DateTime.Now;
                    model.GESnapshot.IMG = GEImg;
                    bll.AddGoods(model, gcPid, hidGG.Split(','), strGAV);
                }
                else
                {
                    int        gcp         = 0;
                    GoodsBasic updateModel = bll.GetModelByGBid(model.ID, out gcp, LoginUser.UserBasic.EnterpriseID);
                    isSale                        = updateModel.IsSale.ToString();
                    model.IsSale                  = updateModel.IsSale;
                    model.Status                  = updateModel.Status;
                    model.EnterpriseID            = updateModel.EnterpriseID;
                    model.AddTime                 = updateModel.AddTime;
                    model.Sorting                 = updateModel.Sorting;
                    model.GESnapshot.AddTime      = updateModel.GESnapshot.AddTime;
                    model.GESnapshot.Status       = updateModel.GESnapshot.Status;
                    model.GESnapshot.GoodsBasicID = updateModel.GESnapshot.GoodsBasicID;
                    model.GESnapshot.EnterpriseID = updateModel.GESnapshot.EnterpriseID;
                    model.GESnapshot.IMG          = GEImg;
                    isSale                        = model.IsSale.ToString();
                    bll.UpdateGoods(model, gcPid, hidGG.Split(','), strGAV);
                }
                return(Json(new ReturnData <string>()
                {
                    Status = true,
                    Data = isSale
                }));
            }
            else
            {
                return(Json(new ReturnData <string>()
                {
                    Status = false,
                    Message = "该商品名称已被占用"
                }));
            }
        }
 /// <summary>
 /// 选择商品页的总数
 /// </summary>
 /// <param name="GoodsBasicIDs"></param>
 /// <param name="name"></param>
 /// <param name="GoodsClassFirst"></param>
 /// <param name="GoodsClassSecond"></param>
 /// <param name="groupId"></param>
 /// <returns></returns>
 public long GetAutoGoodsBasicTotal(string GoodsBasicIDs = "", string name = "", int GoodsClassFirst = -1, int GoodsClassSecond = -1, int groupId = -1)
 {
     GoodsBasicBll bll = new GoodsBasicBll();
     return bll.GetListCount(GoodsBasicIDs, name, GoodsClassFirst, GoodsClassSecond, groupId, LoginUser.UserBasic.EnterpriseID);
 }
 /// <summary>
 /// 获取商品列表总数
 /// </summary>
 /// <param name="GName">商品名称</param>
 /// <param name="CId">类目ID</param>
 /// <param name="PCId">一级类目ID</param>
 /// <param name="isSelect">是否选购:0:未选购,1:已选购</param>
 /// <returns></returns>
 public JsonResult GetAllCount(string GName="", int CId=0, int PCId=0, int IsSelect=0)
 {
     int cgid = 0;
     GoodsBasicBll bll = new GoodsBasicBll();
     return Json(bll.GetAllCountByAgent(GName, CId, PCId, AgentLoginUser.UserBasic.EnterpriseID, AgentLoginUser.RoleID, IsSelect, cgid), JsonRequestBehavior.AllowGet);
 }
 public JsonResult GetList(string GName = "", int PCid = 0, int CId = 0, int IsStatus = 0, int GId = 0, int IsSales = 0, int PageIndex = 1, int PageSize = 10)
 {
     if (PageIndex == 0) PageIndex = 1;
     GoodsBasicBll bll = new GoodsBasicBll();
     return Json(bll.GetGBList(GName, CId, PCid, IsStatus, LoginUser.UserBasic.EnterpriseID, GId, IsSales, PageIndex, PageSize), JsonRequestBehavior.AllowGet);
 }
 /// <summary>
 /// 选择商品页的分页数据
 /// </summary>
 /// <param name="GoodsBasicIDs"></param>
 /// <param name="name"></param>
 /// <param name="GoodsClassFirst"></param>
 /// <param name="GoodsClassSecond"></param>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <param name="groupId"></param>
 /// <returns></returns>
 public ActionResult AutoGoodsBasicPage(string GoodsBasicIDs = "", string name = "", int GoodsClassFirst = -1, int GoodsClassSecond = -1, int pageIndex = 1, int pageSize = 5, int groupId = -1)
 {
     GoodsBasicBll bll = new GoodsBasicBll();
     long Total = 0;
     var list = bll.GetGoodsBasicList(ref Total, GoodsBasicIDs, name, GoodsClassFirst, GoodsClassSecond, pageIndex, pageSize, groupId, LoginUser.UserBasic.EnterpriseID);
     ViewBag.Total = Total;
     ViewBag.List = list;
     return PartialView();
 }
        public ActionResult OperateSave(Model.GoodsBasic model)
        {
            GESnapshotBll geBll = new GESnapshotBll();
            GESnapshot ges = geBll.GetGesModel(model.ID, model.GESnapshot.GName);
            if (ges == null)
            {
                string isSale = "";
                GoodsBasicBll bll = new GoodsBasicBll();
                //可视分组
                string hidGG = Request["hidGG"];
                //属性规格
                string hidGAV = HttpUtility.HtmlDecode(Request["hidGAV"]);
                int gcPid = int.Parse(Request["gClassP"]);
                int gcid = int.Parse(Request["gClass"]);
                Decimal lowerP = Decimal.Parse(Request["txtPriceLower"]);
                Decimal upperP = Decimal.Parse(Request["txtPriceUpper"]);
                string GEImg = Request["hidGEImg"];
                model.GoodsClassID = gcid;
                if (model.RType == 2)
                {
                    model.MinPrice = 0;
                    model.MaxPrice = 0;
                }
                else
                {
                    model.MinPrice = lowerP;
                    model.MaxPrice = upperP;
                }
                model.BarCode = (model.BarCode == null) ? "" : model.BarCode;
                model.GModel = (model.GModel == null) ? "" : model.GModel;
                model.SaleNum = (model.SaleNum == null) ? 0 : model.SaleNum;
                model.CommentNum = (model.CommentNum == null) ? 0 : model.CommentNum;
                List<Hashtable> strGAV = JsonConvert.DeserializeObject<List<Hashtable>>(hidGAV);
                if (model.ID == 0)
                {
                    isSale = "1";
                    model.IsSale = 1;
                    model.Status = 0;
                    model.EnterpriseID = LoginUser.UserBasic.EnterpriseID;
                    model.AddTime = DateTime.Now;
                    model.GESnapshot.IMG = GEImg;
                    bll.AddGoods(model, gcPid, hidGG.Split(','), strGAV);
                }
                else
                {
                    int gcp = 0;
                    GoodsBasic updateModel = bll.GetModelByGBid(model.ID, out gcp, LoginUser.UserBasic.EnterpriseID);
                    isSale = updateModel.IsSale.ToString();
                    model.IsSale = updateModel.IsSale;
                    model.Status = updateModel.Status;
                    model.EnterpriseID = updateModel.EnterpriseID;
                    model.AddTime = updateModel.AddTime;
                    model.Sorting = updateModel.Sorting;
                    model.GESnapshot.AddTime = updateModel.GESnapshot.AddTime;
                    model.GESnapshot.Status = updateModel.GESnapshot.Status;
                    model.GESnapshot.GoodsBasicID = updateModel.GESnapshot.GoodsBasicID;
                    model.GESnapshot.EnterpriseID = updateModel.GESnapshot.EnterpriseID;
                    model.GESnapshot.IMG = GEImg;
                    isSale = model.IsSale.ToString();
                    bll.UpdateGoods(model, gcPid, hidGG.Split(','), strGAV);
                }
                return Json(new ReturnData<string>()
                {
                    Status = true,
                    Data = isSale
                });
            }
            else
            {
                return Json(new ReturnData<string>()
                {
                    Status = false,
                    Message = "该商品名称已被占用"
                });
            }

        }
 /// <summary>
 /// 修改单个商品
 /// </summary>
 /// <param name="gaid"></param>
 /// <param name="ptype"></param>
 /// <param name="price"></param>
 /// <param name="pMin"></param>
 /// <param name="pMax"></param>
 /// <returns></returns>
 public ActionResult EditGoodsAgent(long gaid)
 {
     GoodsAgentBll gabll=new GoodsAgentBll();
     var ga=gabll.GetArray(w=>w.ID==gaid,x=>new {x.GoodsBasicID,x.Price,x.RType});
     GoodsBasicBll bll = new GoodsBasicBll();
     var gb=bll.GetArray(w=>w.ID==ga[0].GoodsBasicID,x=>new {x.MaxPrice,x.MinPrice});
     GCSnapshotBll gcsbll = new GCSnapshotBll();
     var ges = gcsbll.GetArray(w => w.GoodsAgentID == gaid && w.Status == 0, x => new { x.AContent });
     ViewBag.gaid = gaid;
     ViewBag.ptype = ga[0].RType;
     ViewBag.price =ga[0].Price;
     ViewBag.pMin = gb[0].MinPrice;
     ViewBag.pMax =gb[0].MaxPrice;
     ViewBag.content = (ges.Count()<1) ? "" : ges[0].AContent;
     return View();
 }
 public JsonResult GetAllCount(string GName = "", int PCid = 0, int CId = 0, int IsStatus = 0, int GId = 0, int IsSales = 0)
 {
     GoodsBasicBll bll = new GoodsBasicBll();
     return Json(bll.GetAllCount(GName, CId, PCid, IsStatus, LoginUser.UserBasic.EnterpriseID, GId, IsSales), JsonRequestBehavior.AllowGet);
 }