Ejemplo n.º 1
0
        public async Task <ActionResult> GotoExam(int pkid, string pid, decimal price, int type, decimal?cost, decimal?PurchasePrice, int?totalstock, int?num_week, int?num_month, decimal?guidePrice, decimal nowPrice, string maoliLv, string chaochu, decimal?jdself, decimal?maolie)
        {
            var resultExam = BaoYangPriceGuideManager.GotoAudit(type > 0, ThreadIdentity.Operator.Name, pid, cost, PurchasePrice, totalstock, num_week, num_month, guidePrice, nowPrice, maoliLv, chaochu, jdself, maolie);
            var model      = BaoYangPriceGuideManager.FetchPriceAudit(pkid);

            if (type <= 0)
            {
                TuhuMessage.SendEmail("[被驳回]保养品价格修改申请", model.ApplyPerson, $"您于{DateTime.Now}申请将{model.PID}保养品价格修改为{model.ApplyPrice}元,已被{model.AuditPerson}驳回。");
                return(Json(resultExam));
            }
            int result = -99;

            if (resultExam > 0 && type > 0)
            {
                if (!string.Equals(model.Type, "QPLPrice", StringComparison.CurrentCultureIgnoreCase))
                {
                    result = await UpdatePriceAsync(pid, price, $"通过保养价格指导系统审核通过后修改({model.ApplyReason})");
                }
                else
                {
                    var manager = new BaoYangPriceGuideManager();
                    var dic     = new Dictionary <string, decimal>();
                    dic.Add(pid, price);
                    var qplprice = manager.GetQPLPriceBypid(pid);
                    var msg      = await manager.UpdateQPLProductPriceByPidAsync(dic, User.Identity.Name);

                    if (!string.IsNullOrWhiteSpace(msg))
                    {
                        PriceManager.InsrtCouponPriceHistory(new CouponPriceHistory()
                        {
                            PID = pid, OldPrice = qplprice, NewPrice = price, ChangeUser = User.Identity.Name, ChangeDateTime = DateTime.Now, ChangeReason = $"通过GLXT审核通过后修改(申请原因:{ model.ApplyReason})"
                        });
                        result = 1;
                    }
                    else
                    {
                        result = -4;
                    }
                }
            }
            return(Json(result));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 修改汽配龙价格
        /// </summary>
        /// <param name="pid"></param>
        /// <param name="price"></param>
        /// <param name="originalPrice"></param>
        /// <returns></returns>
        public async Task <JsonResult> UpdateQPLPrice(string pid, decimal price, decimal originalPrice, string changeReason = "")
        {
            if (string.IsNullOrWhiteSpace(pid) || price <= 0)
            {
                return(Json(new { Status = false, Msg = "参数验证失败" }, JsonRequestBehavior.AllowGet));
            }
            var manager = new BaoYangPriceGuideManager();
            var dic     = new Dictionary <string, decimal>();

            dic.Add(pid, price);
            var msg = await manager.UpdateQPLProductPriceByPidAsync(dic, User.Identity.Name);

            if (string.IsNullOrWhiteSpace(msg))
            {
                return(Json(new { Status = false }, JsonRequestBehavior.AllowGet));
            }
            PriceManager.InsrtCouponPriceHistory(new CouponPriceHistory()
            {
                PID = pid, OldPrice = originalPrice, NewPrice = price, ChangeUser = User.Identity.Name, ChangeDateTime = DateTime.Now, ChangeReason = string.IsNullOrWhiteSpace(changeReason) ? "通过GLXT修改" : changeReason
            });
            return(Json(new { Status = true }, JsonRequestBehavior.AllowGet));
        }