Exemplo n.º 1
0
        /// <summary>
        /// 类目
        /// </summary>
        /// <returns></returns>
        public ViewResult Category()
        {
            tbClientUser clientuser = GetUser("UserInfo");

            ViewData["SPLM"] = isi.ReutrnSPLM(clientuser.UserNick);
            return(View());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 检查图片空间
        /// </summary>
        private string CheckPictureSpace(string PictureCategoryName)
        {
            string             Result      = null;
            tbClientUser       clientuser  = GetUser("UserInfo");
            PictureCategoryGet PicCategory = new PictureCategoryGet();

            PicCategory.PictureCategoryName = PictureCategoryName;
            List <PictureCategory> list = new List <PictureCategory>();

            list = sgi.GetPictureCategory(PicCategory, clientuser.UserShops[0].SessionKey);
            PictureCategory picc;

            //if (list != null)
            //{
            //    picc = new PictureCategory();
            //    picc = list[0];
            //    Result = picc.PictureCategoryId.ToString();
            //}
            //else
            //{
            //    picc = new PictureCategory();
            //    picc = sgi.AddImageCategroy(clientuser.UserShops[0].SessionKey, PictureCategoryName, "0");
            //    Result = picc.PictureCategoryId.ToString();
            //}
            return("1837616344513"); //Result;
        }
Exemplo n.º 3
0
        private List <Trade> GetListtrade(tradeRateQueryCls tradeRatestr, out long TotalResults)
        {
            string       errorMsg   = string.Empty;
            bool         hasnext    = false;
            tbClientUser clientuser = GetUser("UserInfo");

            TotalResults = 0;
            TradesSoldGet TradesSold = new TradesSoldGet();

            TradesSold.Tid = tradeRatestr.Tid == 0 ? null : tradeRatestr.Tid.ToString();
            //获取买家已评,卖家未评价订单信息
            if (string.IsNullOrEmpty(tradeRatestr.RateStatus))
            {
                TradesSold.RateStatus = null;
            }
            else
            {
                TradesSold.RateStatus = tradeRatestr.RateStatus;
            }
            TradesSold.BuyerNick  = tradeRatestr.BuyerNick;
            TradesSold.PageNo     = tradeRatestr.PageNo;
            tradeRatestr.PageSize = tradeRatestr.PageSize;
            if (tradeRatestr.Tid == null)
            {
                return(iiti.GetTradesSoldToTradeRate(clientuser.UserShops[0].SessionKey, TradesSold, out errorMsg, out hasnext, out TotalResults));
            }
            else
            {
                List <Trade> lisaa = new List <Trade>();
                Trade        trade = new Trade();
                trade = iiti.GetTrade(clientuser.UserShops[0].SessionKey, tradeRatestr.Tid.ToString(), out errorMsg);
                lisaa.Add(trade);
                return(lisaa);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 通过Cid获取属性
        /// </summary>
        /// <returns></returns>
        public JsonResult GetItencatsByCid(string Cids, string ParentCid)
        {
            tbClientUser   clientuser = GetUser("UserInfo");
            List <ItemCat> result     = gic.GetItemcats(Cids, ParentCid);

            return(Json(result));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 仓库中的商品
        /// </summary>
        /// <returns></returns>
        public ViewResult InStock()
        {
            tbClientUser clientuser = GetUser("UserInfo");

            ViewData["SPLM"] = isi.ReutrnSPLM(clientuser.UserNick);
            ViewData["DPLM"] = isi.ReturnDPLM();
            return(View());
        }
Exemplo n.º 6
0
        /// <summary>
        /// 评价模板
        /// </summary>
        /// <returns></returns>
        public ViewResult RateTemple()
        {
            tbClientUser clientuser = GetUser("UserInfo");

            //取系统默认评价模板
            ViewData["systemtemper"] = br.GetTradeRateByShopId(-1);
            return(View(br.GetTradeRateByShopId(clientuser.UserShops[0].Shop.ShopId)));
        }
Exemplo n.º 7
0
        /// <summary>
        /// 返回授权的类目列表
        /// </summary>
        /// <returns></returns>
        public List <ItemCat> AuthorizeItemcat(string token)
        {
            tbClientUser    clientuser = GetUser("UserInfo");
            SellerAuthorize cats       = new SellerAuthorize();

            cats = gic.GetAuthorizeItemcat(token);
            return(cats.ItemCats);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 查找仓库商品
        /// </summary>
        /// <param name="QueryStr"></param>
        /// <returns></returns>
        private IList <Item> SearchGoodsInventory(ref int totalNum, MYDZ.Entity.Goods.QueryCriteriaForInventory QueryStr = null)
        {
            IList <Item> list       = null;
            tbClientUser clientuser = GetUser("UserInfo");

            list = goodsinfo.ReturnInventoryByCriteria(clientuser.UserShops[0].SessionKey.ToString(), ref totalNum, QueryStr);
            return(list);
        }
Exemplo n.º 9
0
        /// <summary>
        /// 运费
        /// </summary>
        /// <returns></returns>
        public ViewResult Freight()
        {
            tbClientUser            clientuser = GetUser("UserInfo");
            List <DeliveryTemplate> list       = goodsinfo.GetDeliveryTemplates(clientuser.UserShops[0].SessionKey);

            ViewData["list"] = list;
            return(View());
        }
Exemplo n.º 10
0
        //选择类目属性
        public ViewResult ChooseItemprop(string Cids = null)
        {
            tbClientUser    clientuser = GetUser("UserInfo");
            SellerAuthorize sa         = new SellerAuthorize();

            sa = gic.GetAuthorizeItemcat(clientuser.UserShops[0].SessionKey);
            ViewData["ListCats"] = sa.ItemCats;
            return(View());
        }
Exemplo n.º 11
0
        public JsonResult UploadGoodsImg()
        {
            byte[]       byData       = null;
            JsonResult   result       = null;
            tbClientUser clientuser   = GetUser("UserInfo");
            string       RootFilePath = MYDZ.Business.StaticSystemConfig.soft.RootFilePath;

            try
            {
                System.Web.HttpPostedFileBase file = Request.Files["fileToUpload"];
                if (file == null)
                {
                    return(null);
                }
                if (file.ContentLength > 500 * 1024)
                {
                    return(Json(new { URL = "", ErrorMsg = "大于500KB,上传失败!" }));
                }
                string hzm = file.FileName.Substring(file.FileName.LastIndexOf('.') + 1).ToLower();
                if (hzm != "jpg" && hzm != "gif" && hzm != "png")
                {
                    return(Json(new { URL = "", ErrorMsg = "选择的文件不是图片文件!" }));
                }

                using (Stream stream = file.InputStream)
                {
                    byData          = new Byte[stream.Length];
                    stream.Position = 0;
                    stream.Read(byData, 0, byData.Length);
                    stream.Close();
                }
                string PictureCategoryName = "商品图片-魔云店长";
                string cid = CheckPictureSpace(PictureCategoryName);
                if (cid == null)
                {
                    return(null);
                }
                string        errormsg = null;
                PictureUpload pu       = new PictureUpload();
                pu.ImageInputTitle   = file.FileName;
                pu.PictureCategoryId = long.Parse(cid);
                pu.Img = byData;
                Picture picture = new Picture();
                picture = sgi.PictureUpload(pu, clientuser.UserShops[0].SessionKey, out errormsg);
                if (errormsg == null)
                {
                    result = Json(new { URL = picture.PicturePath, ErrorMsg = "" });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Exemplo n.º 12
0
        /// <summary>
        /// 获取淘宝未完成订单并插入数据库
        /// </summary>
        public void GetResquestBacklogOrder(TradesSoldGet TradesSold, tbClientUser clientuser, IList <StoreLogistics> StoreLogisticsList, tbOrdersConfig Config, DateTime?LastModifyTime)
        {
            Hashtable ht = new Hashtable();

            ht.Add("clientuser", clientuser);
            ht.Add("TradesSoldGet", TradesSold);
            ht.Add("LogisticsList", StoreLogisticsList);
            ht.Add("Config", Config);
            ht.Add("LastModifyTime", LastModifyTime);
            StartRun(ht);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 将淘宝返回的User类型转化为本地需要的类型
        /// </summary>
        /// <param name="UserId"></param>
        /// <returns></returns>
        private tbClientUser Changetype(string Accesstoken, string ExpiresTime)
        {
            Top.Api.Domain.User SimppleUser = GetInfo.GetUser(Accesstoken);
            tbClientUser        us          = new tbClientUser();

            try
            {
                us.TbUserId = (int)SimppleUser.UserId;
                us.UserNick = SimppleUser.Nick;

                us.Gender = new tbClientUserGender();
                us.Credit = new tbClientUserCredit();
                us.Status = new tbClientUserStatus();
                us.Type   = new tbClientUserType();
                us.Level  = new tbClientUserLevel();

                us.Gender.GenderId = Utils.GetEnum <UserGender>(SimppleUser.Sex, UserGender.m).GetHashCode();
                us.Status.StatusId = Utils.GetEnum <UserStatus>(SimppleUser.Status, UserStatus.normal).GetHashCode();
                us.Level.LevelId   = Utils.GetEnum <UserLevel>(SimppleUser.VipInfo, UserLevel.asso_vip).GetHashCode();
                us.Type.TypeId     = Utils.GetEnum <UserType>(SimppleUser.Type, UserType.B).GetHashCode();
                us.Credit.GoodNum  = (int)SimppleUser.SellerCredit.GoodNum;
                us.Credit.Level    = (int)SimppleUser.SellerCredit.Level;
                us.Credit.Score    = (int)SimppleUser.SellerCredit.Score;
                us.Credit.TotalNum = (int)SimppleUser.SellerCredit.TotalNum;
                us.AlipayBind      = SimppleUser.AlipayBind.Equals("bind") ? true : false;
                us.HasMorePic      = SimppleUser.HasMorePic;
                us.ItemImgNum      = (int)SimppleUser.ItemImgNum;
                us.ItemImgSize     = (int)SimppleUser.ItemImgSize;
                us.PropImgNum      = (int)SimppleUser.PropImgNum;
                us.PropImgSize     = (int)SimppleUser.PropImgSize;
                us.Protection      = SimppleUser.ConsumerProtection;
                us.Avatar          = SimppleUser.Avatar;
                us.LiangPin        = SimppleUser.Liangpin;
                us.SignFoods       = SimppleUser.SignFoodSellerPromise;
                us.HasShop         = SimppleUser.HasShop;
                us.Level           = us.Level;
                us.IsLightning     = SimppleUser.IsLightningConsignment;
                us.HasSubStock     = SimppleUser.HasSubStock;
                us.GoldenSeller    = SimppleUser.IsGoldenSeller;
                us.Subscribe       = SimppleUser.MagazineSubscribe;
                us.VerMarket       = SimppleUser.VerticalMarket;
                us.OnlineGaming    = SimppleUser.OnlineGaming;
                us.EmailNum        = 0;
                us.SMSNum          = 0;
                us.Currency        = 0;
                us.Validity        = DateTime.Parse(ExpiresTime);
                us.InputDate       = DateTime.Now.ToLocalTime();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(us);
        }
Exemplo n.º 14
0
        /// <summary>
        /// 刪除商品
        /// </summary>
        /// <param name="ListGoodsId"></param>
        /// <returns></returns>
        public Task <ActionResult> GoodsDeleteGoods(string ListGoodsId)
        {
            tbClientUser clientuser = GetUser("UserInfo");

            return(Task.Factory.StartNew(() =>
            {
                goodsinfo.DeleteGoods(ListGoodsId, clientuser.UserShops[0].SessionKey);
                AsyncManager.Timeout = 5000;
            }).ContinueWith <ActionResult>(task =>
            {
                return Json("");
            }));
        }
Exemplo n.º 15
0
        public Task <ActionResult> SetBatchUnShelve(string ListGoodId)
        {
            tbClientUser clientuser = GetUser("UserInfo");

            return(Task.Factory.StartNew(() =>
            {
                goodsinfo.BatchUnShelve(clientuser.UserShops[0].SessionKey, ListGoodId);
                AsyncManager.Timeout = 5000;
            }).ContinueWith <ActionResult>(task =>
            {
                Response.Redirect("/Merchandise/OnSale.html");
                Response.End();
                return View();
            }));
        }
Exemplo n.º 16
0
        /// <summary>
        /// 父子订单批量评价
        /// </summary>
        /// <param name="traderatestr"></param>
        /// <returns></returns>
        public JsonResult ParentRateList(tradeRateQueryCls traderatestr)
        {
            tbClientUser clientuser = GetUser("UserInfo");
            string       errorMsg   = string.Empty;
            Trade        listtrade  = new Trade();

            listtrade = iiti.GetTrade(clientuser.UserShops[0].SessionKey, traderatestr.Tid.ToString(), out errorMsg);
            if (listtrade != null || errorMsg == null)
            {
                if (DateTime.Now.Date.AddDays(-15).CompareTo(DateTime.Parse(listtrade.EndTime).Date) <= 0)
                {
                    iit.AddTradeRateList(clientuser.UserShops[0].SessionKey, traderatestr);
                }
            }
            return(Json(new { Result = true }));
        }
Exemplo n.º 17
0
        /// <summary>
        /// 批量修改商品库存
        /// </summary>
        /// <returns></returns>
        public Task <ActionResult> SetUpdateGoodsStoke(ItemQuantityUpdate goods)
        {
            tbClientUser clientuser = GetUser("UserInfo");

            return(Task.Factory.StartNew(() =>
            {
                List <string> errorMsgs;
                goodsinfo.UpdateStoke(clientuser.UserShops[0].SessionKey, goods, out errorMsgs);
                AsyncManager.Timeout = 5000;
                AsyncManager.Parameters["content"] = errorMsgs;
            }).ContinueWith <ActionResult>(task =>
            {
                List <string> errorMsg = (List <string>)AsyncManager.Parameters["content"];
                return Json(new { ErrorMsg = errorMsg });
            }));
        }
Exemplo n.º 18
0
        /// <summary>
        /// 通过Code 来获取AccessToken
        /// 括号内的东西 , string itemCode = null
        /// </summary>
        public tbClientUser FromCodeToGetAccesToken(string code)
        {
            var Item = new { AccessToken = "", ExpiresIn = DateTime.MinValue };

            Item = Tools.Utils.TypeConversion(GetInfo.GetAccesstoken(code), Item);

            //将淘宝返回的User类型转化为本地需要的类型
            tbClientUser us = Changetype(Item.AccessToken, Item.ExpiresIn.ToString());
            Hashtable    ht = new Hashtable();

            ht.Add("TbUserId", us.TbUserId);
            ht.Add("AccessToken", Item.AccessToken);
            DataCache.SetCache("UserClientInfo" + us.TbUserId, ht);
            //保存用户数据
            return(Save(us, Item.AccessToken, Item.ExpiresIn.ToString()));
        }
Exemplo n.º 19
0
        /// <summary>
        /// 批量修改商品信息
        /// </summary>
        /// <returns></returns>
        public Task <ActionResult> SetupdateGoods(ItemUpdate goods)
        {
            tbClientUser clientuser = GetUser("UserInfo");
            string       ErrorMsg   = string.Empty;

            return(Task.Factory.StartNew(() =>
            {
                List <string> errorMsg = new List <string>();
                goodsinfo.simpleupdategoods(clientuser.UserShops[0].SessionKey, goods, out errorMsg);
                AsyncManager.Timeout = 5000;
                AsyncManager.Parameters["content"] = errorMsg;
            }).ContinueWith <ActionResult>(task =>
            {
                List <string> errorMsg = (List <string>)AsyncManager.Parameters["content"];
                return Json(new { ErrorMsg = errorMsg });
            }));
        }
Exemplo n.º 20
0
        /// <summary>
        /// 商场评价解释接口
        /// </summary>
        /// <param name="Oid"></param>
        /// <param name="Reply"></param>
        /// <returns></returns>
        public JsonResult TraderateExplain(long Oid, string Reply)
        {
            tbClientUser      clientuser               = GetUser("UserInfo");
            tradeRateQueryCls tradeRatestr             = new tradeRateQueryCls();
            List <Entity.Traderate.TradeRate> listrate = new List <Entity.Traderate.TradeRate>();

            tradeRatestr.Tid = Oid;
            listrate         = iit.GetTraderateList(clientuser.UserShops[0].SessionKey, tradeRatestr);
            if (listrate != null)
            {
                if (DateTime.Now.Date.AddDays(-15).CompareTo(DateTime.Parse(listrate[0].Created).Date) <= 0)
                {
                    iit.AddTradeRateExplain(clientuser.UserShops[0].SessionKey, Oid, Reply);
                }
            }
            return(Json(""));
        }
Exemplo n.º 21
0
        /// <summary>
        /// 批量更新商品描述
        /// </summary>
        /// <param name="goods"></param>
        /// <returns></returns>
        public Task <ActionResult> UpdateGoodsDesc(ItemUpdate goods)
        {
            tbClientUser  clientuser = GetUser("UserInfo");
            List <string> errorMsg;

            return(Task.Factory.StartNew(() =>
            {
                errorMsg = new List <string>();
                goodsinfo.UpdateGoodsDesc(goods, clientuser.UserShops[0].SessionKey, out errorMsg);
                AsyncManager.Parameters["content"] = errorMsg;
            }).ContinueWith <ActionResult>(task =>
            {
                errorMsg = new List <string>();
                errorMsg = (List <string>)AsyncManager.Parameters["content"];
                return Json(new { ErrorMsg = errorMsg });
            }));
        }
Exemplo n.º 22
0
        /// <summary>
        /// 商品上架
        /// </summary>
        /// <param name="ListGoodsId"></param>
        /// <returns></returns>
        public Task <ActionResult> GoodsShelf(string ListGoodsId, string ShelfGoodsNum = "0")
        {
            tbClientUser  clientuser = GetUser("UserInfo");
            List <string> errorMsgs;

            return(Task.Factory.StartNew(() =>
            {
                errorMsgs = new List <string>();
                goodsinfo.GoodsShelf(clientuser.UserShops[0].SessionKey, ListGoodsId, ShelfGoodsNum, out errorMsgs);
                AsyncManager.Timeout = 5000;
                AsyncManager.Parameters["content"] = errorMsgs;
            }).ContinueWith <ActionResult>(task =>
            {
                errorMsgs = new List <string>();
                errorMsgs = (List <string>)AsyncManager.Parameters["content"];
                return Json(new { ErrorMsg = errorMsgs });
            }));
        }
Exemplo n.º 23
0
        public ViewResult Index()
        {
            // 仅做测试之用
            tbClientUser     User = new tbClientUser();
            tbClientUserShop sh   = new tbClientUserShop();

            sh.SessionKey  = "6201f00fhj8b68346bac1b7fae0cf20b50b30f6929dd558264760512";
            sh.UserId      = 15;
            sh.Shop        = new Entity.Shop.tbShopInfo();
            sh.Shop.ShopId = 20;
            User.UserNick  = "andrinuo旗舰店";
            User.UserShops = new List <tbClientUserShop>();
            User.UserShops.Add(sh);
            User.UserId = 15;
            //tbClientUser User = new UserInfo().FromCodeToGetAccesToken(code);
            Session["UserInfo"] = User;

            return(View());
        }
Exemplo n.º 24
0
        public JsonResult SveGoodsSetting(Skus skuitems)
        {
            tbClientUser clientuser = GetUser("UserInfo");
            IList <Item> listitem   = new List <Item>();
            IList <Skus> listsku    = new List <Skus>();

            try
            {
                listitem = goodsinfo.Getitem(clientuser.UserShops[0].SessionKey, skuitems.NumIid.ToString());
                listsku  = goodsinfo.GetItemSkus(clientuser.UserShops[0].SessionKey, skuitems.SkuId.ToString());
                BItems bi = new BItems();
                BSkus  bs = new BSkus();
                if (listitem != null)
                {
                    if (bi.GetItems(skuitems.NumIid.ToString()).Count() <= 0)
                    {
                        bi.AddItems(listitem[0]);
                    }
                }
                if (listsku != null)
                {
                    foreach (Skus item in listsku)
                    {
                        if (item.SkuId.Equals(skuitems.SkuId))
                        {
                            if (bs.GetSkus(skuitems.SkuId.ToString()).Count() <= 0)
                            {
                                bs.AddSkus(skuitems);
                            }
                            else
                            {
                                bs.UpdateSkus(skuitems);
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(Json(new { Result = true }));
        }
Exemplo n.º 25
0
        public JsonResult SaveRateTmple(string result, string content, int sortid = 0)
        {
            bool         res        = false;
            tbClientUser clientuser = GetUser("UserInfo");
            Tb_TradeRate ttr        = new Tb_TradeRate();

            ttr.Content = content;
            ttr.Result  = result;
            ttr.Role    = "seller";
            ttr.ShopId  = clientuser.UserShops[0].Shop.ShopId;
            List <Tb_TradeRate> listtt = new List <Tb_TradeRate>();

            listtt = br.GetTradeRateByShopId(clientuser.UserShops[0].Shop.ShopId);
            if (listtt.Count > 0)
            {
                listtt.Sort((left, right) =>
                {
                    if (left.SortID > right.SortID)
                    {
                        return(-1);
                    }
                    else if (left.SortID == right.SortID)
                    {
                        return(0);
                    }
                    else
                    {
                        return(1);
                    }
                });
                ttr.SortID = listtt[0].SortID + 1;
            }
            else
            {
                ttr.SortID = 1;
            }
            if (br.AddRate(ttr))
            {
                res = true;
            }
            return(Json(new { Result = res }));
        }
Exemplo n.º 26
0
        /// <summary>
        /// 加载评价数据
        /// </summary>
        /// <returns></returns>
        public ViewResult OnloadRate(tradeRateQueryCls tradeRatestr)
        {
            #region

            /* tradeRatestr.RateType = "get";
             * tradeRatestr.Role = "buyer";
             * tradeRatestr.PageNo = tradeRatestr.PageNo == null ? 1 : tradeRatestr.PageNo;
             * tradeRatestr.PageSize = tradeRatestr.PageSize > 0 ? tradeRatestr.PageSize : 40;
             * //获取最近一个月评价记录
             * List<Entity.Traderate.TradeRate> listrate = new List<Entity.Traderate.TradeRate>();
             * listrate = iit.GetTraderateList(clientuser.UserShops[0].SessionKey, tradeRatestr);*/
            #endregion
            tbClientUser  clientuser   = GetUser("UserInfo");
            string        errorMsg     = string.Empty;
            bool          hasnext      = false;
            long          TotalResults = 0;
            TradesSoldGet TradesSold   = new TradesSoldGet();
            List <Trade>  listtrade    = new List <Trade>();
            if (tradeRatestr.StartDate != null || tradeRatestr.EndDate != null)
            {
                tradeRatestr.RateType = "get";
                tradeRatestr.Role     = "buyer";
                List <Entity.Traderate.TradeRate> listrate = new List <Entity.Traderate.TradeRate>();
                listrate = iit.GetTraderateList(clientuser.UserShops[0].SessionKey, tradeRatestr);
                if (listrate != null)
                {
                    foreach (Entity.Traderate.TradeRate item in listrate)
                    {
                        tradeRatestr.Tid = item.Tid;
                        listtrade.AddRange(GetListtrade(tradeRatestr, out TotalResults));
                    }
                }
            }
            else
            {
                listtrade = GetListtrade(tradeRatestr, out TotalResults);
            }
            ViewData["totalpage"] = TotalResults % 40 == 0 ? TotalResults % 40 : Convert.ToInt32(TotalResults / 40) + 1;
            return(View(listtrade));
        }
Exemplo n.º 27
0
        /// <summary>
        /// 商品重量、简称设置
        /// </summary>
        /// <returns></returns>
        public ViewResult GoodsSetting(QueryCriteriaForOnSales QueryStr)
        {
            int           TotalNum = 0;
            IList <Item>  list     = new List <Item>();
            IList <Skus>  listSkus = new List <Skus>();
            List <string> ListSPID = new List <string>();

            tbClientUser clientuser = GetUser("UserInfo");

            list = SearchGoodsOnsales(ref TotalNum, QueryStr);
            if (list != null)
            {
                foreach (Item item in list)
                {
                    ListSPID.Add(item.NumIid.ToString());
                }
                if (ListSPID != null)
                {
                    if (ListSPID.Count <= 40)
                    {
                        listSkus = goodsinfo.GetItemSkus(clientuser.UserShops[0].SessionKey, string.Join(",", ListSPID.ToArray()));
                    }
                    BSkus bs = new BSkus();
                    foreach (Skus item in listSkus)
                    {
                        IList <Skus> listsku = bs.GetSkus(item.SkuId.ToString());
                        if (listsku.Count > 0)
                        {
                            item.SPJC = listsku[0].SPJC;
                            item.SPZL = listsku[0].SPJC;
                            item.CBJ  = listsku[0].CBJ;
                        }
                    }
                }
            }
            ViewData["listSkus"] = listSkus;

            return(View(list));
        }
Exemplo n.º 28
0
        public Task <JsonResult> batchUpdateRate(string OidList, int sortid, bool IsSystemDefault = false)
        {
            tbClientUser clientuser = GetUser("UserInfo");

            return(Task.Factory.StartNew(() =>
            {
                if (string.IsNullOrEmpty(OidList))
                {
                    try
                    {
                        Tb_TradeRate ttr = new Tb_TradeRate();
                        if (IsSystemDefault)
                        {
                            ttr = br.GetTradeRateBySortId(sortid, clientuser.UserShops[0].Shop.ShopId);
                        }
                        else
                        {
                            ttr = br.GetTradeRateBySortId(sortid, -1);
                        }
                        string[] oiditems = OidList.Split(',');
                        traderateAddQueryCls traderatestr = new traderateAddQueryCls();
                        traderatestr.Content = ttr.Content;
                        traderatestr.Result = ttr.Result;
                        foreach (string item in oiditems)
                        {
                            traderatestr.Oid = Convert.ToInt64(item);
                            iit.AddTradeRate(clientuser.UserShops[0].SessionKey, traderatestr);
                        }
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }).ContinueWith <JsonResult>(task =>
            {
                return Json(new { Result = true });
            }));
        }
Exemplo n.º 29
0
        /// <summary>
        /// 添加商品页面
        /// </summary>
        /// <returns></returns>
        public ViewResult AddGoods(string SelectItemCid, string Pvs, string Type, string AttrKeys)
        {
            tbClientUser     clientuser    = GetUser("UserInfo");
            List <ItemProp>  list          = new List <ItemProp>();
            List <PropValue> listpropvalue = new List <PropValue>();

            if (string.IsNullOrEmpty(SelectItemCid))
            {
                Response.End();
                Response.Redirect("/Merchandise/ChooseItemprop.html", true);
            }
            Session["SelectItemCid"] = SelectItemCid;
            list          = gic.GetItemprops(SelectItemCid);
            listpropvalue = gic.GetItemPropValues(SelectItemCid, null, "1", null);

            List <DeliveryTemplate> DeliveryTemplate = goodsinfo.GetDeliveryTemplates(clientuser.UserShops[0].SessionKey);

            ViewData["Cid"]              = SelectItemCid;
            ViewData["SPLM"]             = isi.ReutrnSPLM(clientuser.UserNick);
            ViewData["DeliveryTemplate"] = DeliveryTemplate;
            return(View());
        }
Exemplo n.º 30
0
        public JsonResult AddItems(ItemAdd goods)
        {
            string       errormsg   = null;
            tbClientUser clientuser = GetUser("UserInfo");

            if (string.IsNullOrEmpty(goods.Desc) && goods.Desc.Length > 5)
            {
                return(Json(new { ErrorMsg = "商品描述字数应大于5小于20000!" }));
            }
            string itemid = goodsinfo.addgoods(clientuser.UserShops[0].SessionKey, goods, out errormsg);

            if (itemid == null)
            {
                return(Json(new { ErrorMsg = errormsg }));
            }
            string[] path = goods.ChildPicPath.Split('^');
            if (path == null)
            {
                return(Json(new { ErrorMsg = "" }));
            }
            ItemJointImg itemjoin;

            for (int i = 0; i < path.Count(); i++)
            {
                if (string.IsNullOrEmpty(path[i]) && i.ToString().Length > 5)
                {
                    string str = "http://img03.tbsandbox.com/imgextra/";
                    itemjoin          = new ItemJointImg();
                    itemjoin.NumIid   = long.Parse(itemid);
                    itemjoin.PicPath  = path[i].ToString().Substring(str.Length - 1, path[i].ToString().Length - str.Length + 1);
                    itemjoin.Position = long.Parse(path[i + 1]);
                    sgi.ImgItemJoint(clientuser.UserShops[0].SessionKey, itemjoin, out errormsg);
                }
            }
            return(Json(new { ErrorMsg = errormsg }));
        }