/// <summary>
        /// 添加收货地址
        /// </summary>
        /// <returns></returns>
        public ActionResult AddressAdd()
        {
            Model.ConsigneeInfoBase ci = new Model.ConsigneeInfoBase();
            string cID = RequestBase.GetString("cID");
            GetProvice();
            if (!string.IsNullOrWhiteSpace(cID))
            {//修改
                ci = _consigneeInfoBase.GetModel(Convert.ToInt32(cID));
                ViewData["CityList"] = GetCity(ci.c_Provice.Value, "City");
                ViewData["CountList"] = GetCity(ci.c_City.Value, "Count");
                ViewData["ProviceTxt"] = ci.c_CProvice;
                ViewData["Provice"] = ci.c_Provice;
                ViewData["CityTxt"] = ci.c_CCity;
                ViewData["City"] = ci.c_City;
                ViewData["CountTxt"] = ci.c_CCount;
                ViewData["Count"] = ci.c_Count;
                ViewData["name"] = ci.c_Name;
                ViewData["phone"] = ci.c_Mobilephone;
                ViewData["zipCode"] = ci.c_Zipcode;
                ViewData["address"] = ci.c_FullAddress;
            }
            ViewData["cID"] = cID;

            return View();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加收货人
        /// </summary>
        public ActionResult AddConsigneeInfo()
        {
            int cid = 0;
            bool isAdd = true;
            if (RequestBase.GetString("otype") == "modify")
            {
                cid = Convert.ToInt32(RequestBase.GetString("cid"));
                isAdd = false;
            }
            var name = RequestBase.GetString("name");
            var selectType = RequestBase.GetString("selectType");
            var selectType2 = RequestBase.GetString("selectType2");
            var selectType3 = RequestBase.GetString("selectType3");
            var Address = RequestBase.GetString("Address");
            var phone = RequestBase.GetString("phone");
            var tphone = RequestBase.GetString("tphone");
            var zipcode = RequestBase.GetString("zipcode");

            var model = new Model.ConsigneeInfoBase();
            if (!isAdd)
            {
                model = _consigneeInfo.GetModel(cid);
            }
            else
            {
                model.c_IsDel = 0;
                model.c_Moren = 0;
                model.c_StatusCode = 0;
                model.m_ID = LoginMember.m_ID;
            }
            model.c_Provice = Convert.ToInt32(selectType);
            model.c_City = Convert.ToInt32(selectType2);
            model.c_Count = Convert.ToInt32(selectType3);
            model.c_FullAddress = Address;
            model.c_Mobilephone = phone;
            model.c_Telephone = tphone;
            model.c_Name = name;
            model.c_Zipcode = zipcode;
            try
            {
                if (isAdd)
                {
                    int id = _consigneeInfo.Add(model);
                    model = _consigneeInfo.GetModel(id);
                }
                else
                {
                    if (_consigneeInfo.Update(model))
                    {
                        model = _consigneeInfo.GetModel(model.c_ID);
                    }
                    else
                    {
                        model = null;
                    }
                }
            }
            catch
            {
                model = null;
            }
            return View(model);
        }
 //订单详情
 public ActionResult VipOrderDetail()
 {
     int oid = 0;
     int mid = 0;
     if (LoginMember != null)
     {
         if (!string.IsNullOrEmpty(RequestBase.GetString("oid")))
         {
             oid = int.Parse(RequestBase.GetString("oid"));
         }
         mid = (CookieEncrypt.DeserializeObject(System.Web.HttpContext.Current.Request.Cookies["UserInfo"].Value) as Model.MemberBase).m_ID;
         //订单信息
         ViewBag.orderinfo = obll.GetModel(oid);
         ViewData["status"] = ViewBag.orderinfo.o_StatusCode;
         Model.ConsigneeInfoBase conmodel = new Model.ConsigneeInfoBase();
         int? cid = obll.GetModel(oid).c_ID;
         //收货人信息
         ViewBag.coninfo = new BLL.ConsigneeInfoBase().GetModel(int.Parse(cid.ToString()));
         //订单商品明细
         var orderskulist = vobll.GetModelList(" m_ID=" + mid + " and o_ID=os_oID and o_Code='" + obll.GetModel(oid).o_Code + "'");
         if (orderskulist.Count > 0)
         {
             ViewBag.ordersku = orderskulist;
             string skulist = "";
             string countlist = "";
             decimal pricecount=0;
             foreach (var sku in ViewBag.ordersku)
             {
                 skulist += sku.sku_ID + ",";
                 countlist += sku.os_pCount + ",";
                 pricecount += sku.sku_Price * sku.os_pCount;
             }
             skulist = skulist.Substring(0, skulist.Length - 1);
             countlist = countlist.Substring(0, countlist.Length - 1);
             ViewData["skulist"] = skulist;
             ViewData["countlist"] = countlist;
             ViewData["yuanjia"] = pricecount;
         }
         ////支付方式
         ViewBag.payfor = new BLL.PaymentBase().GetModel(int.Parse(obll.GetModel(oid).pay_ID.ToString()));
         //配送方式
         ViewBag.stname = new BLL.ShipTypeBase().GetModel(int.Parse(obll.GetModel(oid).st_ID.ToString()));
         //订单追踪
         ViewBag.orderstatus = new BLL.OrderStatusBase().GetModelList(" o_ID=" + oid + " and os_IsDel=0");
         //折扣
         var member = new BLL.MemberBase().GetModel(mid);
         if (member != null)
         {
             var ranklist = new BLL.VipRank().GetModelList(member.m_Score + " between r_score and r_upperscore ");
             if (ranklist.Count > 0)
             {
                 ViewData["zhek"] = ranklist[0].r_ZheK;
             }
         }
         ViewData["maxstatus"] = new BLL.OrderStatusBase().Getmaxstatus(" o_ID=" + oid + " and os_IsDel=0");
         return View();
     }
     else
     {
         Response.Redirect("/wapLogin/Login");
         return View();
     }
 }
Ejemplo n.º 4
0
        public string AddConsigneeInfo()
        {
            string result = "";
            int cid = 0;
            bool isAdd = true;
            if (RequestBase.GetString("otype") == "modify")
            {
                cid = Convert.ToInt32(RequestBase.GetString("cid"));
                isAdd = false;
            }
            var name = RequestBase.GetString("name");
            var selectType = RequestBase.GetString("selectType");
            var selectType2 = RequestBase.GetString("selectType2");
            var selectType3 = RequestBase.GetString("selectType3");
            var Address = RequestBase.GetString("Address");
            var phone = RequestBase.GetString("phone");
            var tphone = RequestBase.GetString("tphone");
            var zipcode = RequestBase.GetString("zipcode");

            var model = new Model.ConsigneeInfoBase();
            if (!isAdd)
            {
                model = _consigneeInfo.GetModel(cid);
            }
            else
            {
                model.c_IsDel = 0;
                model.c_Moren = 0;
                model.c_StatusCode = 0;
                model.m_ID = LoginMember.m_ID;
            }
            model.c_Provice = Convert.ToInt32(selectType);
            model.c_City = Convert.ToInt32(selectType2);
            model.c_Count = Convert.ToInt32(selectType3);
            model.c_FullAddress = Address;
            model.c_Mobilephone = phone;
            model.c_Telephone = tphone;
            model.c_Name = name;
            model.c_Zipcode = zipcode;
            try
            {
                if (isAdd)
                {
                    int id = _consigneeInfo.Add(model);
                    model = _consigneeInfo.GetModel(id);
                }
                else
                {
                    if (_consigneeInfo.Update(model))
                    {
                        model = _consigneeInfo.GetModel(model.c_ID);
                    }
                }
            }
            catch
            {
                model = null;
            }
            if (model != null)
            {
                result = string.Format(@"
                                        <li id='cliId_{0}'>
                                            <p class='alignleft'>
                                                <span>{1}</span>
                                                <span>{2}</span>
                                                <span>{3}</span>
                                                <span>{4}</span>
                                            </p>
                                            <p class='alignright'>
                                                <a href='javascript:void(0)' onclick='EditConsigneeInfo({0},{1})'>编辑</a>丨<a href='javascript:void(0)' onclick='DeleteConsigneeInfo({0})'>删除</a>
                                            </p>
                                        </li>", model.c_ID, model.c_Name, model.c_CProvice + model.c_CCity + model.c_CCount + model.c_FullAddress, model.c_Mobilephone, model.c_Zipcode);
            }
            return result;
        }