/// <summary>
        /// 重新提交订单接口
        /// </summary>
        /// <returns></returns>
        public JsonResult AgainSubmitOrder()
        {
            RequestUser();
            string Img       = UploadFile.GetFile();
            string ordercode = Request["ordercode"];
            string imgs      = Img;
            string msg       = string.Empty;

            if (!string.IsNullOrEmpty(Request["msg"]))
            {
                msg = Request["msg"];
            }
            if (IBOC.AgainBuyerOrder(ordercode, imgs, msg))
            {
                resultData.res = 200;
                resultData.msg = "提交订单成功";
                return(this.ResultJson(resultData));
            }
            else
            {
                resultData.res = 500;
                resultData.msg = "提交订单失败";
                return(this.ResultJson(resultData));
            }
        }
        /// <summary>
        /// 提交订单接口
        /// </summary>
        /// <returns></returns>
        public JsonResult SubmitOrder()
        {
            RequestUser();
            string Img       = UploadFile.GetFile();
            string code      = string.Empty;
            string msg       = string.Empty;
            string ordercode = string.Empty;

            if (!string.IsNullOrEmpty(Request["code"]))
            {
                code = Request["code"];
            }
            string imgs   = Img;
            int    stepId = int.Parse(Request["stepId"]);

            if (!string.IsNullOrEmpty(Request["msg"]))
            {
                msg = Request["msg"];
            }
            string taskcode = Request["taskcode"];

            if (!string.IsNullOrEmpty(Request["ordercode"]))
            {
                ordercode = Request["ordercode"];
            }
            else
            {
                ordercode = Guid.NewGuid().ToString("N");
            }
            if (!string.IsNullOrEmpty(code))
            {
                if (IBOC.AddBuyerOrder(taskcode, ordercode, code, imgs, msg, stepId, us))
                {
                    resultData.res = 200;
                    resultData.msg = "提交订单成功";
                    return(this.ResultJson(resultData));
                }
                else
                {
                    resultData.res = 500;
                    resultData.msg = "提交订单失败";
                    return(this.ResultJson(resultData));
                }
            }
            else
            {
                if (IBOC.AddBuyerOrder(taskcode, ordercode, imgs, msg, stepId, us))
                {
                    resultData.res = 200;
                    resultData.msg = "提交订单成功";
                    return(this.ResultJson(resultData));
                }
                else
                {
                    resultData.res = 500;
                    resultData.msg = "提交订单失败";
                    return(this.ResultJson(resultData));
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <returns></returns>
 public JsonResult EditRangeProduct()
 {
     RequestUser();
     try
     {
         int     ProductID       = int.Parse(Request["ProductID"]);
         int     Url_Asin_Type   = int.Parse(Request["Url_Asin_Type"]);
         string  Url_Asin_Value  = GetParams("Url_Asin_Value");
         int     g_country_value = int.Parse(Request["g_country_value"]);
         var     results         = IDDC.ITEM(g_country, g_country_value);
         int     ProductClassID  = int.Parse(Request["ProductClassID"]);
         string  Title           = Request["Title"];
         string  Label           = Request["Label"];
         string  ProductDescribe = Request["ProductDescribe"];
         string  Img             = UploadFile.GetFile();
         Product bp = new Product();
         bp.Url_Asin        = Url_Asin_Type;
         bp.Url_Asin_Value  = Url_Asin_Value;
         bp.Nation          = g_country_value;
         bp.ID              = ProductID;
         bp.Title           = Title;
         bp.Label           = Label;
         bp.ProductDescribe = ProductDescribe;
         bp.ProductImg      = Img;
         if (IBPC.AddBusinessProduct(bp))
         {
             resultData.res = 200;
             resultData.msg = "添加成功";
             return(this.ResultJson(resultData));
         }
         else
         {
             resultData.res = 500;
             resultData.msg = "添加失败";
             return(this.ResultJson(resultData));
         }
     }
     catch
     {
         resultData.res = 500;
         resultData.msg = "未知异常";
         return(this.ResultJson(resultData));
     }
 }
Beispiel #4
0
        /// <summary>
        /// 添加一个商家产品
        /// </summary>
        /// <returns></returns>
        public JsonResult AddRangeProduct()
        {
            RequestUser();
            string  Url_Asin_Value = string.Empty;
            int     Url_Asin_Type  = 0;
            Product bp             = new Product();

            try
            {
                if (!string.IsNullOrEmpty(Request["Url_Asin_Type"]))
                {
                    Url_Asin_Type = int.Parse(Request["Url_Asin_Type"]);
                }
                if (!string.IsNullOrEmpty(Request["Url_Asin_Value"]))
                {
                    Url_Asin_Value = JsonConvert.DeserializeObject <string>(Request["Url_Asin_Value"]);
                }
                int g_country_value = int.Parse(Request["g_country_value"]);

                int ProductClassID = int.Parse(Request["ProductClassID"]);

                string Title     = JsonConvert.DeserializeObject <string>(Request["Title"]);
                var    listlabel = JsonConvert.DeserializeObject <List <string> >(Request["Label"]);
                string Label     = string.Empty;
                foreach (var item in listlabel)
                {
                    Label = Label + "," + item;
                }
                string ProductDescribe = JsonConvert.DeserializeObject <string>(Request["ProductDescribe"]);
                string Img             = UploadFile.GetFile();
                string ProductNumber   = JsonConvert.DeserializeObject <string>(Request["num"]);
                string Price           = JsonConvert.DeserializeObject <string>(Request["price"]);
                string Commission      = JsonConvert.DeserializeObject <string>(Request["commission"]);

                int    orderType = int.Parse(Request["orderType"]);
                var    result1   = IDDC.ITEM(order_type, orderType);
                int    cmtType   = int.Parse(Request["cmtType"]);
                var    result2   = IDDC.ITEM(comment_type, cmtType);
                string Expired   = JsonConvert.DeserializeObject <string>(Request["expired"]);
                string Remark    = JsonConvert.DeserializeObject <string>(Request["remark"]);
                string EndTime   = JsonConvert.DeserializeObject <string>(Request["endtime"]);
                if (!string.IsNullOrEmpty(Url_Asin_Value))
                {
                    bp.Url_Asin       = Url_Asin_Type;
                    bp.Url_Asin_Value = Url_Asin_Value;
                }
                bp.Nation         = g_country_value;
                bp.Title          = Title;
                bp.OrderType      = result1.Value;
                bp.cmtType        = result2.Value;
                bp.SalesVolume    = 0;
                bp.ProductClassID = ProductClassID;
                bp.EndTime        = DateTime.Parse(EndTime);
                bp.AddTime        = DateTime.Now;
                if (!string.IsNullOrWhiteSpace(Label))
                {
                    bp.Label = Label;
                }
                if (!string.IsNullOrWhiteSpace(ProductDescribe))
                {
                    bp.ProductDescribe = ProductDescribe;
                }
                bp.ProductImg    = Img;
                bp.ProductNumber = int.Parse(ProductNumber);
                bp.Price         = decimal.Parse(Price);
                bp.Commission    = decimal.Parse(Commission);
                bp.Shape         = 1;
                bp.Status        = 1;
                bp.CmtNum        = 0;
                bp.BusinessID    = this.us.ID;
                if (result2.Value == 2)
                {
                    bp.cmtDay = int.Parse(JsonConvert.DeserializeObject <string>(Request["cmtDay"]));
                }
                bp.Expired = int.Parse(Expired);
                if (Remark != "null")
                {
                    bp.Remark = Remark;
                }
                if (IBPC.AddBusinessProduct(bp))
                {
                    resultData.res = 200;
                    resultData.msg = "添加成功";
                    return(this.ResultJson(resultData));
                }
                else
                {
                    resultData.res = 500;
                    resultData.msg = "添加失败";
                    return(this.ResultJson(resultData));
                }
            }
            catch (Exception ex)
            {
                resultData.res  = 500;
                resultData.msg  = ex.Message;
                resultData.data = bp;
                return(this.ResultJson(resultData));
            }
        }