예제 #1
0
        public IActionResult RepairInfo()
        {
            M_Order_Repair repairMod = repBll.SelReturnModel(Mid);

            if (repairMod == null)
            {
                return(WriteErr("退货/返修记录不存在"));
            }
            M_Product proMod  = proBll.GetproductByid(repairMod.ProID);
            M_CartPro cartMod = cartBll.SelReturnModel(repairMod.CartID);

            ViewBag.cartMod = cartMod;
            ViewBag.proMod  = proMod;
            return(View(repairMod));
        }
예제 #2
0
        public void MyBind()
        {
            M_Order_Repair repairMod = repairBll.SelReturnModel(RepairID);

            ServiceType_L.Text = GetServieType(repairMod.ServiceType);
            ProNum_L.Text      = repairMod.ProNum.ToString();
            Deailt_T.InnerText = repairMod.Deailt;
            Attach_Hid.Value   = repairMod.ProImgs.Trim('|');
            CretType_L.Text    = GetCret(repairMod.CretType);
            ReType_L.Text      = GetReType(repairMod.ReProType);
            TakeCounty_L.Text  = repairMod.TakeProCounty;
            TakeAddress_L.Text = repairMod.TakeProAddress;
            TakeTime_L.Text    = repairMod.TakeTime.ToString();
            ReCounty_L.Text    = repairMod.ReProCounty;
            ReAddress_L.Text   = repairMod.ReProAddress;
            UserName_L.Text    = repairMod.UserName;
            Phone_L.Text       = repairMod.Phone;
        }
예제 #3
0
        public IActionResult ReqRepair_Add()
        {
            int       Cid     = DataConverter.CLng(RequestEx["cid"]);
            M_CartPro cartMod = cartBll.SelReturnModel(Cid);

            if (repBll.SelByCartID(Cid) != null)
            {
                return(WriteErr("该商品已申请售后,不可重复申请!", "MyOrderRepair"));
            }
            //----------------------
            M_Order_Repair repairMod = new M_Order_Repair();

            repairMod.Deailt         = RequestEx["Deailt"];
            repairMod.CretType       = RequestEx["cret"];
            repairMod.ReProType      = DataConverter.CLng(RequestEx["ReProType_Hid"]);
            repairMod.TakeProCounty  = RequestEx["province_dp"] + " " + RequestEx["city_dp"] + " " + RequestEx["county_dp"];
            repairMod.TakeProAddress = RequestEx["TakeProAddress"];
            repairMod.ReProCounty    = RequestEx["reprovince_dp"] + " " + RequestEx["recity_dp"] + " " + RequestEx["recounty_dp"];
            repairMod.ReProAddress   = RequestEx["ReProAddress"];
            repairMod.UserName       = RequestEx["UserName"];
            repairMod.Phone          = RequestEx["Phone"];
            repairMod.ProImgs        = RequestEx["Attach_Hid"];
            repairMod.ProID          = cartMod.ProID;
            repairMod.OrderNO        = orderBll.SelReturnModel(cartMod.Orderlistid).OrderNo;
            repairMod.ServiceType    = RequestEx["ServicesType_Hid"];
            repairMod.UserID         = mu.UserID;
            repairMod.CartID         = cartMod.ID;
            repairMod.ProNum         = DataConverter.CLng(RequestEx["ProNum"]);
            //----------------------
            if (repairMod.ProNum > cartMod.Pronum)
            {
                return(WriteErr("退换商品数量不能大于购买数量"));
            }
            repBll.Insert(repairMod);
            cartMod.AddStatus = StrHelper.AddToIDS(cartMod.AddStatus, repairMod.ServiceType);
            cartBll.UpdateByID(cartMod);
            return(WriteOK("添加成功!", "MyOrderRepair"));
        }
예제 #4
0
        public IActionResult ReqRepair()
        {
            int Cid = DataConverter.CLng(RequestEx["cid"]);//购物车ID

            if (repBll.SelByCartID(Cid) != null)
            {
                return(WriteErr("该商品已申请售后!", "MyOrderRepair"));
            }
            M_Order_Repair repairMod = repBll.SelReturnModel(Mid);
            M_Product      proMod    = null;
            M_CartPro      cartMod   = null;
            M_OrderList    orderMod  = null;

            if (repairMod != null)//修改
            {
                proMod   = proBll.GetproductByid(repairMod.ProID);
                cartMod  = cartBll.SelReturnModel(repairMod.CartID);
                orderMod = orderBll.GetOrderListByid(cartMod.Orderlistid);
            }
            else//申请
            {
                repairMod = new M_Order_Repair()
                {
                    ProNum = 1, ReProType = 1
                };
                cartMod = cartBll.SelReturnModel(Cid);
                proMod  = proBll.GetproductByid(cartMod.ProID);
                if (proMod == null)
                {
                    return(WriteErr("需要操作的商品不存在"));
                }
                if (cartMod == null)
                {
                    return(WriteErr("购物数据不存在"));
                }
                orderMod = orderBll.GetOrderListByid(cartMod.Orderlistid);
                if (orderMod.Userid != mu.UserID)
                {
                    return(WriteErr("你无权申请该商品退货"));
                }
                repairMod.TakeProCounty  = orderMod.Shengfen;
                repairMod.ReProCounty    = orderMod.Shengfen;
                repairMod.TakeProAddress = orderMod.Jiedao;
                repairMod.ReProAddress   = orderMod.Jiedao;
                repairMod.UserName       = orderMod.Rename;
                repairMod.Phone          = orderMod.MobileNum;
            }


            //该商品支持的服务类型
            string[] services    = proMod.GuessXML.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            string   ServiceType = "";

            for (int i = 0; i < services.Length; i++)
            {
                switch (services[i])
                {
                case "drawback":
                    ServiceType += "<div data-value='drawback' class='type_div'>退货</div>";
                    break;

                case "exchange":
                    ServiceType += "<div data-value='exchange' class='type_div'>换货</div>";
                    break;

                case "repair":
                    ServiceType += "<div data-value='repair' class='type_div'>维修</div>";
                    break;
                }
            }
            if (services.Length == 0 || string.IsNullOrEmpty(ServiceType))
            {
                return(WriteErr("该商品不能返修或退货!", "OrderList"));
            }
            if (repairMod.ID == 0)
            {
                repairMod.ServiceType = services[0];
            }
            DataRow cartDR = DBCenter.Sel(cartMod.TbName, "ID=" + cartMod.ID).Rows[0];

            cartDR["CartID"]    = cartDR["ID"];
            ViewBag.cartDR      = cartDR;
            ViewBag.orderMod    = orderMod;
            ViewBag.ServiceType = ServiceType;
            ViewBag.cartMod     = cartMod;
            ViewBag.proMod      = proMod;
            return(View(repairMod));
        }