Ejemplo n.º 1
0
        public ActionResult Modify(int orderid)
        {
            Inpinke_Order model = DBOrderBLL.GetOrderByID(orderid);

            if (model == null)
            {
                //跳转到出错页面
                return(Redirect("/error.htm?msg=对不起没有找到您要修改的订单"));
            }
            ViewBag.Order = model;
            IList <Inpinke_Order_Product> prodList = DBOrderBLL.GetOrderProduct(model.ID);

            if (prodList == null)
            {
                //跳转到出错页面
                return(Redirect("/error.htm?msg=对不起没有找到您要修改的订单"));
            }
            ViewBag.ProductList = prodList;
            IList <Inpinke_User_Address> address = DBAddressBLL.GetUserAddress(UserSession.CurrentUser.ID);

            if (address != null && address.Count() > 0)
            {
                ViewBag.UserAddress = address;
            }
            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Edit(int id, string msg)
        {
            ViewBag.Msg = msg;
            Inpinke_Order model = DBOrderBLL.GetOrderByID(id);

            if (model == null)
            {
                return(RedirectToAction("index", new { msg = "未找到要编辑的订单" }));
            }
            //获取订单礼品
            ViewBag.OrderProducts = DBOrderBLL.GetOrderProduct(model.ID);
            return(View(model));
        }
Ejemplo n.º 3
0
        public ActionResult Detail(int orderid)
        {
            Inpinke_Order model = DBOrderBLL.GetOrderByID(orderid);
            IList <Inpinke_Order_Product> prodList = DBOrderBLL.GetOrderProduct(model.ID);

            if (prodList == null)
            {
                //跳转到出错页面
                return(Redirect("/error.htm?msg=对不起没有找到您要支付的订单"));
            }
            ViewBag.ProductList = prodList;
            ViewBag.Order       = model;
            return(View());
        }
Ejemplo n.º 4
0
        public ActionResult Index(int orderid)
        {
            Inpinke_Order model = DBOrderBLL.GetOrderByID(orderid);

            if (model == null)
            {
                ViewBag.Msg = "对不起,没有找到您要支付的订单,请尝试重新登录下单。";
                return(View("error"));
            }

            //必填参数//
            //请与贵网站订单系统中的唯一订单号匹配
            string out_trade_no = model.OrderCode;
            //订单名称,显示在支付宝收银台里的“商品名称”里,显示在支付宝的交易管理的“商品名称”的列表里。
            string subject = "Inpinke-印品客印品";
            //订单描述、订单详细、订单备注,显示在支付宝收银台里的“商品描述”里
            string body = "您在Inpinke-印品客网站定制印刷的" + model.Inpinke_Order_Products.Count() + "件印品";
            //订单总金额,显示在支付宝收银台里的“应付总额”里
            string total_fee = model.TotalPrice.ToString();

            //扩展功能参数——默认支付方式//

            //默认支付方式,代码见“即时到帐接口”技术文档
            string paymethod = "";
            //默认网银代号,代号列表见“即时到帐接口”技术文档“附录”→“银行列表”
            string defaultbank = "";

            //扩展功能参数——防钓鱼//

            //防钓鱼时间戳
            string anti_phishing_key = "";
            //获取客户端的IP地址,建议:编写获取客户端IP地址的程序
            string exter_invoke_ip = "";
            //注意:
            //请慎重选择是否开启防钓鱼功能
            //exter_invoke_ip、anti_phishing_key一旦被设置过,那么它们就会成为必填参数
            //建议使用POST方式请求数据
            //示例:
            //exter_invoke_ip = "";
            //Service aliQuery_timestamp = new Service();
            //anti_phishing_key = aliQuery_timestamp.Query_timestamp();               //获取防钓鱼时间戳函数

            //扩展功能参数——其他//

            //商品展示地址,要用http:// 格式的完整路径,不允许加?id=123这类自定义参数
            string show_url = AlipayConfig.Show_Url;
            //自定义参数,可存放任何内容(除=、&等特殊字符外),不会显示在页面上
            string extra_common_param = "";
            //默认买家支付宝账号
            string buyer_email = "";

            //扩展功能参数——分润(若要使用,请按照注释要求的格式赋值)//

            //提成类型,该值为固定值:10,不需要修改
            string royalty_type = "";
            //提成信息集
            string royalty_parameters = "";
            //注意:
            //与需要结合商户网站自身情况动态获取每笔交易的各分润收款账号、各分润金额、各分润说明。最多只能设置10条
            //各分润金额的总和须小于等于total_fee
            //提成信息集格式为:收款方Email_1^金额1^备注1|收款方Email_2^金额2^备注2
            //示例:
            //royalty_type = "10";
            //royalty_parameters = "[email protected]^0.01^分润备注一|[email protected]^0.01^分润备注二";
            //构造即时到帐接口表单提交HTML数据,无需修改
            //把请求参数打包成数组
            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("payment_type", "1");
            sParaTemp.Add("show_url", show_url);
            sParaTemp.Add("out_trade_no", out_trade_no);
            sParaTemp.Add("subject", subject);
            sParaTemp.Add("body", body);
            sParaTemp.Add("total_fee", total_fee);
            sParaTemp.Add("paymethod", paymethod);
            sParaTemp.Add("defaultbank", defaultbank);
            sParaTemp.Add("anti_phishing_key", anti_phishing_key);
            sParaTemp.Add("exter_invoke_ip", exter_invoke_ip);
            sParaTemp.Add("extra_common_param", extra_common_param);
            sParaTemp.Add("buyer_email", buyer_email);
            sParaTemp.Add("royalty_type", royalty_type);
            sParaTemp.Add("royalty_parameters", royalty_parameters);

            AlipayService ali       = new AlipayService();
            string        sHtmlText = ali.Create_direct_pay_by_user(sParaTemp);

            return(Content(sHtmlText));
        }
Ejemplo n.º 5
0
        public ActionResult Edit(FormCollection col)
        {
            int orderid = int.Parse(col["ID"]);

            try
            {
                Inpinke_Order model = DBOrderBLL.GetOrderByID(orderid);
                ViewBag.Order = model;
                IList <Inpinke_Order_Product> prodList = DBOrderBLL.GetOrderProduct(model.ID);
                ViewBag.ProductList = prodList;

                decimal totalPrice = 0;
                foreach (Inpinke_Order_Product p in prodList)
                {
                    int bookid = p.BookID;
                    if (string.IsNullOrEmpty(col["num_" + bookid]))
                    {
                        totalPrice += p.Price;
                        continue;
                    }
                    p.Num = int.Parse(col["num_" + bookid]);
                    if (p.Num <= 0)
                    {
                        ViewBag.Msg = "印品购买数量不能少于1件";
                        return(RedirectToAction("edit", new { id = orderid, msg = ViewBag.Msg + DateTime.Now.ToString("yyyy-MM-dd mm:ss") }));
                    }
                    p.CouponID   = int.Parse(col["coupon_select_" + bookid]);
                    p.Envelope   = int.Parse(col["envelope_" + bookid]);
                    p.Price      = DBBookBLL.GetBookPrice(bookid, p.CouponID, p.Num);
                    p.UpdateTime = DateTime.Now;
                    p.SaveWhenSubmit(InpinkeDataContext.Instance);
                    totalPrice += p.Price;
                }
                model.OrgPrice   = totalPrice;
                model.TotalPrice = totalPrice;
                int orgOrderStatus = model.OrderStatus;
                model.OrderStatus = int.Parse(col["OrderStatus"]);
                model.UserRemark  = col["Remark"];
                //收货人信息
                model.RecUserName = col["UserName"];
                model.RecMobile   = col["Mobile"];
                model.RecAddress  = col["Address"];
                model.RecAreaID   = int.Parse(col["AreaID"]);
                model.RecProvID   = int.Parse(col["ProvID"]);
                model.RecCityID   = int.Parse(col["CityID"]);
                model.RecProvName = DBProvinceBLL.GetProvName(model.RecProvID.Value);
                model.RecCityName = DBProvinceBLL.GetCityName(model.RecCityID.Value);
                model.RecAreaName = DBProvinceBLL.GetAreaName(model.RecAreaID.Value);

                model.UpdateTime = DateTime.Now;
                model.SaveWhenSubmit(InpinkeDataContext.Instance);
                InpinkeDataContext.Instance.Submit();
                //锁定印品防止编辑
                if (model.OrderStatus == (int)OrderStatus.WaitSend && orgOrderStatus != (int)OrderStatus.WaitSend)
                {
                    SetOrderMaking(model, "", true);
                }
                if (model.OrderStatus != (int)OrderStatus.WaitSend && orgOrderStatus == (int)OrderStatus.WaitSend)
                {
                    SetOrderMaking(model, "", false);
                }

                return(RedirectToAction("edit", new { id = orderid, msg = "编辑成功" + DateTime.Now.ToString("yyyy-MM-dd mm:ss") }));
            }
            catch (Exception ex)
            {
                ViewBag.Msg = "修改订单信息失败,请稍后再试";
                Logger.Error(string.Format("修改订单信息-Edit Error:{0}", ex.ToString()));
                return(RedirectToAction("edit", new { id = orderid, msg = ViewBag.Msg + DateTime.Now.ToString("yyyy-MM-dd mm:ss") }));
            }
        }
Ejemplo n.º 6
0
        public ActionResult Modify(FormCollection col)
        {
            try
            {
                int           orderid = int.Parse(col["ID"]);
                Inpinke_Order model   = DBOrderBLL.GetOrderByID(orderid);
                ViewBag.Order = model;
                IList <Inpinke_Order_Product> prodList = DBOrderBLL.GetOrderProduct(model.ID);
                ViewBag.ProductList = prodList;
                IList <Inpinke_User_Address> address = DBAddressBLL.GetUserAddress(UserSession.CurrentUser.ID);
                if (address != null && address.Count() > 0)
                {
                    ViewBag.UserAddress = address;
                }

                model.AddressID = int.Parse(col["AddressID"]);
                Inpinke_User_Address selAddress = DBAddressBLL.GetAddressByID(model.AddressID);
                model.RecUserName = selAddress.UserName;
                model.RecMobile   = selAddress.Mobile;
                model.RecAddress  = selAddress.Address;
                model.RecAreaID   = selAddress.AreaID;
                model.RecProvID   = selAddress.ProvID;
                model.RecCityID   = selAddress.CityID;
                model.RecProvName = selAddress.ProvName;
                model.RecCityName = selAddress.CityName;
                model.RecAreaName = selAddress.AreaName;

                decimal totalPrice = 0;
                foreach (Inpinke_Order_Product p in prodList)
                {
                    int bookid = p.BookID;
                    if (string.IsNullOrEmpty(col["num_" + bookid]))
                    {
                        totalPrice += p.Price;
                        continue;
                    }
                    p.Num = int.Parse(col["num_" + bookid]);
                    if (p.Num <= 0)
                    {
                        ViewBag.Msg = "印品购买数量不能少于1件";
                        return(View());
                    }
                    p.CouponID   = int.Parse(col["coupon_select_" + bookid]);
                    p.Envelope   = int.Parse(col["envelope_" + bookid]);
                    p.Price      = DBBookBLL.GetBookPrice(bookid, p.CouponID, p.Num);
                    p.UpdateTime = DateTime.Now;
                    p.SaveWhenSubmit(InpinkeDataContext.Instance);
                    totalPrice += p.Price;
                }
                model.OrgPrice   = totalPrice;
                model.TotalPrice = totalPrice;
                model.UserRemark = col["Remark"];
                model.UpdateTime = DateTime.Now;
                model.SaveWhenSubmit(InpinkeDataContext.Instance);
                InpinkeDataContext.Instance.Submit();
                return(RedirectToAction("pay", new { orderid = orderid }));
            }
            catch (Exception ex)
            {
                ViewBag.Msg = "修改订单信息失败,请稍后再试";
                Logger.Error(string.Format("修改订单信息-Modify Error:{0}", ex.ToString()));
                return(View("error"));
            }
        }