Esempio n. 1
0
        // 删除
        public IActionResult DeleteGoodsDetails(int?code)
        {
            var Aid = HttpContext.Session.GetString("Aid");

            if (Aid == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            if (code == null)
            {
                return(Content("500"));
            }
            var GoodDetailImage = _context.GoodsDetailImage
                                  .FirstOrDefault(m => m.GoodsDetailCode == code);

            if (GoodDetailImage != null)
            {
                return(Content("404"));
            }
            GoodsDetail goodsDetails = _context.GoodsDetail.FirstOrDefault(u => u.GoodsDetailCode == code);

            _context.GoodsDetail.Remove(goodsDetails);
            _context.SaveChanges();
            return(Content("200"));
        }
Esempio n. 2
0
        //详情
        public ActionResult Detail(int id, int classid)
        {
            var good    = GoodsManage.Getgood(id);
            var classif = GoodsManage.FindAllBooks().Where(p => p.Classify_id == classid);
            var Comment = CommentGoodsManage.findallcomment(id);
            var userid  = Convert.ToInt32(Session["User_id"]);

            ViewModels.GoodsDetail index = new GoodsDetail();
            if (userid > 0)
            {
                var carts = CartManage.Findusercart(userid);

                index.Carts1 = carts;
            }
            if (good == null)
            {
                return(HttpNotFound());
            }
            if (classif == null)
            {
                return(HttpNotFound());
            }
            if (Comment == null)
            {
                return(HttpNotFound());
            }

            index.Goodss   = good;
            index.Goods11  = classif;
            index.Comment1 = Comment;

            return(View(index));
            //return View();
        }
Esempio n. 3
0
 //U
 public int UpdateGood(string AuthKey, string query, string serviceURL, GoodsDetail goodInfo)
 {
     if (!securityManager.CheckSecurityToken(AuthKey))
     {
         throw new Exception("인증된 사용자가 아닙니다");
     }
     return(0);
 }
Esempio n. 4
0
        public ActionResult SelectReply(int commendid)
        {
            var replydf = CommentGoodsManage.findallreply(commendid);

            ViewModels.GoodsDetail der = new GoodsDetail();
            der.Reply1 = replydf;
            return(View(der));
        }
Esempio n. 5
0
        }//End of GetGoodList

        internal GoodDetailProxyVO GetGoodDetail(string goodPK)
        {
            Int64       lngGoodPK = Convert.ToInt64(goodPK);
            GoodsDetail detail    = sqlProxy.GetGoodDetail(new EncryptionService().GetEncryptedKey(this.EncryptionSeed, sqlProxy.GetTime()), this.ServiceURL, lngGoodPK);

            GoodDetailProxyVO detailProxy = new GoodDetailProxyVO();

            detailProxy.GoodsDetail = detail;

            return(detailProxy);
        }//End of GetGoodDetail
        public IActionResult Post(GoodsVM item)
        {
            try
            {
                // open a transacation
                // add goods object
                Goods obj = new Goods()
                {
                    Name         = item.Name,         // 商品名稱
                    Price        = item.Price,        // 商品價格
                    Weight       = item.Weight,       // 商品重量
                    Amount       = item.Amount,       // 商品數量
                    Introduce    = item.Introduce,    // 商品內容
                    CategoriesID = item.CategoriesID, // 商品分類
                    CreateTime   = DateTime.Now       // 建立時間
                };
                _context.Goods.Add(obj);

                // add goodsdetail object
                foreach (var o in item.GoodsDetails)
                {
                    GoodsDetail objDetaill = new GoodsDetail()
                    {
                        GoodsID      = 0,                 // 商品ID
                        CategoriesID = item.CategoriesID, // 商品分類ID
                        ParamsID     = o.ParamsID,        // 參數ID
                        Type         = o.Type,            // 動態參數or靜態屬性
                        Content      = o.Content          // 商品內容
                    };

                    _context.GoodsDetail.Add(objDetaill);
                }

                //_context.SaveChanges();
                int ID = obj.ID;

                return(Ok());
            }
            catch (Exception ex)
            {
                return(NotFound());
            }
        }
        public static GoodsDetailInSql ConvertGoodsInSql(GoodsDetail model)
        {
            if (model != null)
            {
                var r = new GoodsDetailInSql();

                //映射处理
                var map = new TypeMapping<GoodsDetail, GoodsDetailInSql>();
                map.AutoMap();
                map.CopyLeftToRight(model, r);

                r.CategoryId = r.ItemShopCats.Select(e => e.Id).ToList();
                //r.TaxonomyId = r.Categorys.Union(r.Tags).Distinct().Select(e => e.Key).ToList();

                return r;
            }

            return null;
        }
Esempio n. 8
0
    protected void Awake()
    {
        mTrans = this.transform;
        mobj = this.gameObject;

        //初始化时隐藏详情界面
        goodsDetail = mTrans.Find("itemInfo_popUp").GetComponent<GoodsDetail>();
        goodsDetail.Init();

        refreshtime = mTrans.Find("shop_bg/nextTimeRefresh/refresh_title/refresh_time").GetComponent<Text>();
        tipstext = mTrans.Find("shop_bg/Tips/tipsText").GetComponent<Text>();
        tipsimage = mTrans.Find("shop_bg/Tips").GetComponent<Image>();
        
        refreshT = mTrans.Find("crystalRefresh");
        if(refreshT.gameObject.activeInHierarchy)
            refreshT.gameObject.SetActive(false);

        refreshText = refreshT.Find("refreshbackground/Text").GetComponent<Text>();
        refreshBtnCancel = refreshT.Find("refreshbackground/ButtonCancel").GetComponent<Button>();
        refreshBtnSure = refreshT.Find("refreshbackground/ButtonSure").GetComponent<Button>();
    }
Esempio n. 9
0
        //添加动作
        public async Task <IActionResult> GoodsDetailsCreates(int?GoodsInfoCode, string GoodsDetailName, string GoodsDetailPrice, string GoodsDetailSize, string GoodsDetailColor)
        {
            var Aid = HttpContext.Session.GetString("Aid");

            if (Aid == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            if (GoodsInfoCode == null || GoodsDetailName == null || GoodsDetailPrice == null)
            {
                return(Content("404"));
            }
            if (_context.GoodsDetail.Where(a => a.GoodsDetailName == GoodsDetailName).Count() == 0 || _context.GoodsDetail.Where(a => a.GoodsInfoCode == GoodsInfoCode).Count() == 0)
            {
                try
                {
                    var GoodsDetail = new GoodsDetail
                    {
                        GoodsDetailName  = GoodsDetailName,
                        GoodsDetailPrice = GoodsDetailPrice,
                        GoodsDetailSize  = GoodsDetailSize,
                        GoodsDetailColor = GoodsDetailColor,
                        GoodsInfoCode    = Convert.ToInt32(GoodsInfoCode),
                    };
                    _context.Add(GoodsDetail);
                    await _context.SaveChangesAsync();

                    return(Content("200"));
                }
                catch (DbUpdateConcurrencyException)
                {
                    return(Content("500"));
                }
            }
            else
            {
                return(Content("201"));
            }
        }
Esempio n. 10
0
    protected void Awake()
    {
        mTrans = this.transform;
        mobj   = this.gameObject;

        //初始化时隐藏详情界面
        goodsDetail = mTrans.Find("itemInfo_popUp").GetComponent <GoodsDetail>();
        goodsDetail.Init();

        refreshtime = mTrans.Find("shop_bg/nextTimeRefresh/refresh_title/refresh_time").GetComponent <Text>();
        tipstext    = mTrans.Find("shop_bg/Tips/tipsText").GetComponent <Text>();
        tipsimage   = mTrans.Find("shop_bg/Tips").GetComponent <Image>();

        refreshT = mTrans.Find("crystalRefresh");
        if (refreshT.gameObject.activeInHierarchy)
        {
            refreshT.gameObject.SetActive(false);
        }

        refreshText      = refreshT.Find("refreshbackground/Text").GetComponent <Text>();
        refreshBtnCancel = refreshT.Find("refreshbackground/ButtonCancel").GetComponent <Button>();
        refreshBtnSure   = refreshT.Find("refreshbackground/ButtonSure").GetComponent <Button>();
    }
Esempio n. 11
0
 /// <summary>
 /// 商品详细描述
 /// </summary>
 /// <param name="detail"></param>
 /// <returns></returns>
 public WechatpayParameterBuilder Detail(GoodsDetail detail)
 {
     Builder.Add(WechatpayConst.Detail, detail?.ToJson());
     return(this);
 }
Esempio n. 12
0
        public ActionResult AddGoodsDetail(GoodsDetail item)
        {
            var result = _db.Save(item);

            return(RedirectToAction("Goods", new { id = item.Goods.Id }));
        }
Esempio n. 13
0
 public GoodDetailProxyVO()
 {
     GoodsDetail = new GoodsDetail();
 }
Esempio n. 14
0
        public GoodsDetail GetGoodDetail(string AuthKey, string serviceURL, long good_pk)
        {
            if (!securityManager.CheckSecurityToken(AuthKey))
            {
                throw new Exception("인증된 사용자가 아닙니다");
            }
            //쿼리 작성
            string Query = new GoodsQuery().GoodDetails(good_pk);
            //데이터 구하기
            DataTable dt = DBController.getInstance().GetData(serviceURL, Query);
            //데이터 가공
            GoodsDetail detailMaster = new GoodsDetail();

            detailMaster.unitcostList       = new List <unitcost>();
            detailMaster.good_unit_infoList = new List <good_unit_info>();
            detailMaster.goodpartList       = new List <goodpart>();
            detailMaster.goodsellerList     = new List <goodseller>();

            foreach (DataRow dr in dt.Rows)
            {
                foreach (var prop in typeof(GoodsDetail).GetProperties())
                {
                    if (prop.Name == "Item")
                    {
                        continue;
                    }
                    if (prop.Name.Contains("List"))
                    {
                        continue;
                    }
                    if (dr[prop.Name].GetType() == typeof(DBNull))
                    {
                        continue;
                    }
                    detailMaster[prop.Name] = dr[prop.Name];
                }//End of Foreach
                unitcost       unitcost       = new unitcost();
                good_unit_info good_unit_info = new good_unit_info();
                goodpart       goodpart       = new goodpart();
                goodseller     goodseller     = new goodseller();
                foreach (var prop in typeof(unitcost).GetProperties())
                {
                    if (prop.Name == "Item")
                    {
                        continue;
                    }
                    if (dr[prop.Name].GetType() == typeof(DBNull))
                    {
                        continue;
                    }
                    unitcost[prop.Name] = dr[prop.Name];
                }
                foreach (var prop in typeof(good_unit_info).GetProperties())
                {
                    if (prop.Name == "Item")
                    {
                        continue;
                    }
                    if (dr[prop.Name].GetType() == typeof(DBNull))
                    {
                        continue;
                    }
                    good_unit_info[prop.Name] = dr[prop.Name];
                }
                foreach (var prop in typeof(goodpart).GetProperties())
                {
                    if (prop.Name == "Item")
                    {
                        continue;
                    }
                    if (dr[prop.Name].GetType() == typeof(DBNull))
                    {
                        continue;
                    }
                    goodpart[prop.Name] = dr[prop.Name];
                }
                foreach (var prop in typeof(goodseller).GetProperties())
                {
                    if (prop.Name == "Item")
                    {
                        continue;
                    }
                    if (dr[prop.Name].GetType() == typeof(DBNull))
                    {
                        continue;
                    }
                    goodseller[prop.Name] = dr[prop.Name];
                }
                detailMaster.unitcostList.Add(unitcost);
                detailMaster.good_unit_infoList.Add(good_unit_info);
                detailMaster.goodpartList.Add(goodpart);
                detailMaster.goodsellerList.Add(goodseller);
            }//End of Outer Foreach

            return(detailMaster);
        }