public JsonResult UpdateAcceptCustomizedOrder(string orderid, string shopid, string price, string cycel)
        {
            if (!string.IsNullOrEmpty(orderid))
            {
                OrderSynthesis querymodel = new OrderSynthesis();
                querymodel.Id             = long.Parse(orderid);
                querymodel.ZhifuImg       = shopid;
                querymodel.Price          = price;
                querymodel.SynthesisCycle = cycel;
                querymodel.Status         = 2;

                if (ServiceHelper.Create <IOrderSynthesisService>().UpdateAcceptCustomizedOrder(querymodel))
                {
                    return(Json(new { success = true, msg = "操作成功!" }));
                }
                else
                {
                    return(Json(new { success = false, msg = "操作失败!" }));
                }
            }
            else
            {
                return(Json(new { success = false, msg = "操作失败!" }));
            }
        }
예제 #2
0
        /// <summary>
        ///  定制合成-供应商发货
        /// </summary>
        /// <param name="status"></param>
        /// <returns></returns>
        public JsonResult DetailUpdate(long id, int status, string exname = "", string exid = "")
        {
            OrderSynthesis order = ServiceHelper.Create <IOrderSynthesisService>().GetOrderSynthesis(id);

            if (order == null)
            {
                return(Json(new { success = false }));
            }
            else
            {
                try
                {
                    order.Status             = status;
                    order.ExpressConpanyName = exname;
                    order.ShipOrderNumber    = exid;

                    if (id > 0)
                    {
                        OrderSynthesis querymodel = new OrderSynthesis();
                        querymodel.Id                 = id;
                        querymodel.Status             = status;
                        querymodel.ExpressConpanyName = exname;
                        querymodel.ShipOrderNumber    = exid;
                        if (ServiceHelper.Create <IOrderSynthesisService>().OrderSynthesis_DeliverGoods(querymodel))
                        {
                            ServiceHelper.Create <ISiteMessagesService>().SendSiteMessages(order.UserId, (int)MessageSetting.MessageModuleStatus.OrderShipping, "您的订单已发货,请查看。", "chemcloud");

                            return(Json(new { success = true, msg = "操作成功!" }));
                        }
                        else
                        {
                            return(Json(new { success = false, msg = "操作失败!" }));
                        }
                    }
                    else
                    {
                        return(Json(new { success = false, msg = "操作失败!" }));
                    }

                    /*
                     * string strsql = string.Format("update dbo.ChemCloud_OrderSynthesis set Status='" + status + "',ExpressConpanyName='" + exname + "',ShipOrderNumber='" + exid + "'  where Id='" + id + "';");
                     * int result = DbHelperSQL.ExecuteSql(strsql);
                     * if (result > 0)
                     * {
                     *  ServiceHelper.Create<ISiteMessagesService>().SendSiteMessages(order.UserId, (int)MessageSetting.MessageModuleStatus.OrderShipping, "您的订单已发货,请查看。", "chemcloud");
                     *  return Json(new { success = true, msg = "操作成功!" });
                     * }
                     * else
                     * {
                     *  return Json(new { success = false, msg = "操作失败!" });
                     * }
                     */
                }
                catch (Exception)
                {
                    return(Json(new { success = false }));
                }
            }
        }
        /// <summary>
        /// 平台订单详细
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult manage(long id, string sid)
        {
            OrderSynthesis        order  = ServiceHelper.Create <IOrderSynthesisService>().GetOrderSynthesis(id);
            List <AttachmentInfo> models = ServiceHelper.Create <IOrderSynthesisService>().GetAttachmentInfosById(id);

            ViewBag.parentId        = id;
            ViewBag.attachmentInfo  = models;
            ViewBag.attachmentCount = models.Count;
            return(View(order));
        }
예제 #4
0
        public void DelOrderInfo(long id)
        {
            OrderSynthesis opinfo = context.OrderSynthesis.FindById(id);

            if (opinfo != null)
            {
                context.OrderSynthesis.Remove(opinfo);
                context.SaveChanges();
            }
        }
예제 #5
0
        /// <summary>
        /// 定制合成订单详细
        /// </summary>
        /// <returns></returns>
        public ActionResult CustomizedOrderDetail(long id)
        {
            OrderSynthesis model = ServiceHelper.Create <IOrderSynthesisService>().GetOrderSynthesis(id);

            model.UserName = ServiceHelper.Create <IMemberService>().GetMember(model.UserId) == null ? "" : ServiceHelper.Create <IMemberService>().GetMember(model.UserId).UserName;

            List <AttachmentInfo> models = ServiceHelper.Create <IOrderSynthesisService>().GetAttachmentInfosById(id);

            ViewBag.attachmentInfo = models;

            return(View(model));
        }
        public JsonResult GetOrderInfo(long id)
        {
            OrderSynthesis opinfo = ServiceHelper.Create <IOrderSynthesisService>().GetOrderSynthesis(id);

            if (opinfo != null)
            {
                return(Json(opinfo));
            }
            else
            {
                return(Json(""));
            }
        }
예제 #7
0
        /*供应商发货*/
        public bool OrderSynthesis_DeliverGoods(OrderSynthesis _OrderSynthesis)
        {
            /*
             * update dbo.ChemCloud_OrderSynthesis set Status='" + status + "',ExpressConpanyName='" + exname + "',ShipOrderNumber='" + exid + "'  where Id='" + id + "';
             */
            bool           result = false;
            OrderSynthesis model  = context.OrderSynthesis.FindById(_OrderSynthesis.Id);

            if (model != null)
            {
                model.Status             = _OrderSynthesis.Status;
                model.ExpressConpanyName = _OrderSynthesis.ExpressConpanyName;
                model.ShipOrderNumber    = _OrderSynthesis.ShipOrderNumber;
                context.SaveChanges();
                result = true;
            }
            return(result);
        }
예제 #8
0
        /*采购商接受报价*/
        public bool UpdateAcceptCustomizedOrder(OrderSynthesis _OrderSynthesis)
        {
            /*
             * strsql = string.Format("update dbo.ChemCloud_OrderSynthesis set ZhifuImg='" + shopid + "',Price='" + price + "',SynthesisCycle='" + cycel + "',Status=2 where Id='" + orderid + "';");
             */
            bool           result = false;
            OrderSynthesis model  = context.OrderSynthesis.FindById(_OrderSynthesis.Id);

            if (model != null)
            {
                model.Status         = _OrderSynthesis.Status;
                model.ZhifuImg       = _OrderSynthesis.ZhifuImg;
                model.Price          = _OrderSynthesis.Price;
                model.SynthesisCycle = _OrderSynthesis.SynthesisCycle;
                context.SaveChanges();
                result = true;
            }
            return(result);
        }
        public JsonResult UpdateOrderInfo(long id, int status, string zfimg)
        {
            OrderSynthesis opinfo = ServiceHelper.Create <IOrderSynthesisService>().GetOrderSynthesis(id);

            if (opinfo != null)
            {
                if (!string.IsNullOrWhiteSpace(zfimg))
                {
                    opinfo.ZhifuImg = zfimg;
                }
                opinfo.Status = status;
                ServiceHelper.Create <IOrderSynthesisService>().UpdateOrderSynthesis(opinfo);
                return(Json(new { Successful = true }));
            }
            else
            {
                return(Json(new { Successful = false }));
            }
        }
예제 #10
0
        /// <summary>
        /// 添加合成订单
        /// </summary>
        /// <param name="productName"></param>
        /// <param name="productCount"></param>
        /// <param name="productChundu"></param>
        /// <param name="productPrice"></param>
        /// <param name="productDesc"></param>
        /// <param name="orderDate"></param>
        /// <param name="email"></param>
        /// <param name="companyName"></param>
        /// <param name="conUser"></param>
        /// <param name="webSite"></param>
        /// <param name="telPhone"></param>
        /// <returns></returns>
        public JsonResult AddOrderInfo(string productName, string casNo, string chemName, string productCount, string productChundu, string productPrice, string productDesc, string email, string companyName, string conUser, string webSite = "", string telPhone = "", string mol = "", string SynthesisCycle = "")
        {
            IOrderSynthesisService iops = ServiceHelper.Create <IOrderSynthesisService>();
            int i;

            if (!int.TryParse(productCount, out i))
            {
                return(Json(new { Successful = "请输入有效的数量" }));
            }
            ChemCloud.Service.Order.Business.OrderBO _orderBO = new ChemCloud.Service.Order.Business.OrderBO();
            OrderSynthesis op = new OrderSynthesis
            {
                OrderNumber    = _orderBO.GenerateOrderNumber().ToString(),
                ProductName    = productName,
                ProductCount   = productCount,
                ProductPurity  = productChundu,
                Price          = productPrice,
                ProductDesc    = productDesc,
                Email          = email,
                CompanyName    = companyName,
                ConUserName    = conUser,
                ConWebsite     = webSite,
                ConTelPhone    = telPhone,
                OrderTime      = DateTime.Now,
                UserId         = base.CurrentUser.Id,
                Status         = 0,
                Mol            = mol,
                CASNo          = casNo,
                ChemName       = chemName,
                SynthesisCycle = SynthesisCycle
            };
            OrderSynthesis models = iops.AddOrderSynthesis(op);

            if (models != null)
            {
                return(Json(new { Successful = true, parentId = models.Id }));
            }
            else
            {
                return(Json(new { Successful = false }));
            }
        }
예제 #11
0
        /// <summary>
        /// 平台审核定制合成订单
        /// </summary>
        /// <param name="status"></param>
        /// <returns></returns>
        public JsonResult ManUpdate(long id, int status = 1, string reply = "")
        {
            OrderSynthesis order = ServiceHelper.Create <IOrderSynthesisService>().GetOrderSynthesis(id);

            if (order == null)
            {
                return(Json(new { Successful = false }));
            }
            order.Status = status;

            if (!string.IsNullOrWhiteSpace(reply))
            {
                order.OperatorMessage = reply;
            }

            ServiceHelper.Create <IOrderSynthesisService>().UpdateOrderSynthesis(order);
            string messagecontent = "chemcloud确认了定制合成订单:" + id + ",请查看。";

            ServiceHelper.Create <ISiteMessagesService>().SendSiteMessages(order.UserId, (int)MessageSetting.MessageModuleStatus.OrderCreated, messagecontent, "chemcloud");
            return(Json(new { Successful = true }));
        }
예제 #12
0
        /// <summary>
        /// 修改采购订单
        /// </summary>
        /// <param name="op"></param>
        public void UpdateOrderSynthesis(OrderSynthesis op)
        {
            if (op == null || op.Id == 0)
            {
                return;
            }
            OrderSynthesis OP = context.OrderSynthesis.FirstOrDefault((OrderSynthesis m) => m.Id == op.Id);

            if (OP == null)
            {
                return;
            }
            OP.ProductName        = op.ProductName;
            OP.ProductCount       = op.ProductCount;
            OP.ProductPurity      = op.ProductPurity;
            OP.ProductDesc        = op.ProductDesc;
            OP.OrderTime          = op.OrderTime;
            OP.Email              = op.Email;
            OP.CompanyName        = op.CompanyName;
            OP.ConUserName        = op.ConUserName;
            OP.ConWebsite         = op.ConWebsite;
            OP.ConTelPhone        = op.ConTelPhone;
            OP.Status             = op.Status;
            OP.IsLock             = op.IsLock;
            OP.UserId             = op.UserId;
            OP.Price              = op.Price;
            OP.Mol                = op.Mol;
            OP.CASNo              = op.CASNo;
            OP.ChemName           = op.ChemName;
            OP.UserId             = op.UserId;
            OP.OrderNumber        = op.OrderNumber;
            OP.OperatorMessage    = op.OperatorMessage;
            OP.ZhifuImg           = op.ZhifuImg;
            OP.ExpressConpanyName = op.ExpressConpanyName;
            OP.ShipOrderNumber    = op.ShipOrderNumber;
            OP.SynthesisCost      = op.SynthesisCost;
            OP.SynthesisCycle     = op.SynthesisCycle;
            context.SaveChanges();
        }
예제 #13
0
        /// <summary>
        /// 新增采购订单
        /// </summary>
        /// <param name="op"></param>
        public OrderSynthesis AddOrderSynthesis(OrderSynthesis op)
        {
            OrderSynthesis OrderSynInfos = new OrderSynthesis();

            if (op == null || op.Id != 0)
            {
                return(OrderSynInfos);
            }
            else
            {
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    try
                    {
                        OrderSynInfos = op;
                        OrderSynInfos = context.OrderSynthesis.Add(OrderSynInfos);
                        context.SaveChanges();
                        transactionScope.Complete();
                    }
                    catch (DbEntityValidationException dbEx) { }
                }
                return(OrderSynInfos);
            }
        }
예제 #14
0
        public JsonResult EditOrderInfo(long id, string productName, string casNo, string chemName, string productCount, string productChundu, string productPrice, string productDesc, string email, string companyName, string conUser, string webSite = "", string telPhone = "", string mol = "", string SynthesisCycle = "")
        {
            OrderSynthesis opinfo = ServiceHelper.Create <IOrderSynthesisService>().GetOrderSynthesis(id);

            if (id != 0)
            {
                OrderSynthesis op = new OrderSynthesis
                {
                    Id             = id,
                    OrderNumber    = opinfo.OrderNumber,
                    ProductName    = productName,
                    ProductCount   = productCount,
                    ProductPurity  = productChundu,
                    Price          = productPrice,
                    ProductDesc    = productDesc,
                    Email          = email,
                    CompanyName    = companyName,
                    ConUserName    = conUser,
                    ConWebsite     = webSite,
                    ConTelPhone    = telPhone,
                    OrderTime      = opinfo.OrderTime,
                    UserId         = base.CurrentUser.Id,
                    Status         = 0,
                    Mol            = opinfo.Mol,
                    CASNo          = casNo,
                    ChemName       = chemName,
                    SynthesisCycle = SynthesisCycle
                };
                ServiceHelper.Create <IOrderSynthesisService>().UpdateOrderSynthesis(op);
                return(Json(new { Successful = true }));
            }
            else
            {
                return(Json(new { Successful = false }));
            }
        }