Beispiel #1
0
        /// <summary>
        /// 申请返款
        /// </summary>
        /// <param name="context"></param>
        public void SubmitRebates(HttpContext context)
        {
            string orderId = context.Request["orderId"];

            if (string.IsNullOrEmpty(orderId))
            {
                context.Response.Write("{\"msg\":\"没有可以提交的销售单。\",\"success\":\"false\"}");
                return;
            }
            var    order  = new BLL.Order();
            string result = "";

            foreach (string s in orderId.Split(new char[] { ',' }))
            {
                if (order.SubmitOrders(s, order.GetOrderByPKID(orderId).CustomerID.ToString()).Length > 0)
                {
                    result += "不可提交";
                }
                else if (!CommonFunction.CheckOrderAttach(int.Parse(orderId), "attachRequireSale"))
                {
                    result += "电子资料不全。具体要求查看在线帮助。";
                }
                else
                {
                    result += order.SubmitRebates(orderId);
                }
            }
            result = (result.Length > 0) ? "部分销售单不能申请返款。可能以下情况:<BR>1.被禁止申请返款;2.已提交过<BR>3.未填写交车记录;4.车型不符合返款规定;5.电子资料不全" : "";
            context.Response.Write("{\"msg\":\" " + result + "\",\"success\":\"false\"}");
        }
Beispiel #2
0
        /// <summary>
        /// 获取一个订单的完全信息
        /// </summary>
        /// <param name="orderId">订单ID</param>
        /// <param name="viewOriginal">查看原始订购信息</param>
        /// <returns></returns>
        public Common.Entity.ReportOrder GetOrderFullInfo(int orderId, bool viewOriginal)
        {
            Common.Entity.ReportOrder ordersInfo = new ReportOrder();
            // 订单基本信息
            BLL.Order           bll   = new Order();
            Common.Entity.Order oInfo = bll.GetOrderByPKID(orderId);
            if (oInfo != null)
            {
                ordersInfo.BaseRemark = oInfo.BaseRemark;
                ordersInfo.IsApplyMaxCustomerResources = oInfo.IsApplyMaxCustomerResources == 1 ? "是" : "否";
                ordersInfo.BuyWay             = oInfo.BuyWay;
                ordersInfo.CarUse             = oInfo.CarUse;
                ordersInfo.CreateTime         = oInfo.CreateTime == null ? new DateTime(1990, 1, 1) : (DateTime)oInfo.CreateTime;
                ordersInfo.CustomerName       = oInfo.CustomerName;
                ordersInfo.CustomerSuggestion = oInfo.CustomerSuggestion;

                ordersInfo.DealerName             = oInfo.DealerName;
                ordersInfo.DifferentPlace         = oInfo.DifferentPlace == 1 ? "是" : "否";
                ordersInfo.CustomerID             = oInfo.CustomerID;
                ordersInfo.DealerID               = oInfo.DealerID;
                ordersInfo.PKID                   = oInfo.PKID;
                ordersInfo.Watchmaker             = oInfo.Watchmaker;
                ordersInfo.Code                   = oInfo.Code;
                ordersInfo.ReComment1             = oInfo.ReComment1;
                ordersInfo.ReComment2             = oInfo.ReComment2;
                ordersInfo.ReComment3             = oInfo.ReComment3;
                ordersInfo.RecordName             = oInfo.RecordName;
                ordersInfo.ReDate1                = oInfo.ReDate1;
                ordersInfo.ReDate2                = oInfo.ReDate2;
                ordersInfo.ReDate3                = oInfo.ReDate3;
                ordersInfo.ReRemark1              = oInfo.ReRemark1;
                ordersInfo.ReRemark2              = oInfo.ReRemark2;
                ordersInfo.ReRemark3              = oInfo.ReRemark3;
                ordersInfo.Replyer1               = oInfo.Replyer1;
                ordersInfo.Replyer2               = oInfo.Replyer2;
                ordersInfo.Replyer3               = oInfo.Replyer3;
                ordersInfo.OrderState             = oInfo.OrderState;
                ordersInfo.SubmitType             = oInfo.SubmitType;
                ordersInfo.BearUser               = oInfo.BearUser;
                ordersInfo.FN_Email               = oInfo.Email;
                ordersInfo.OffAddressOnCardReport = oInfo.OffAddressOnCardReport == 1 ? "是" : "否";
                ordersInfo.FN_InvoiceDiffer       = oInfo.InvoiceAndCustomerAtypism == 1 ? "是" : "否";
                ordersInfo.FN_InvoiceName         = oInfo.InvoiceCustomerInfo;
            }

            // 客户基本信息
            BLL.Customer           customer = new Customer();
            Common.Entity.Customer cInfo    = customer.GetCustomerByPKID(ordersInfo.CustomerID);
            if (cInfo != null)
            {
                ordersInfo.CustomerAddress       = cInfo.Address;
                ordersInfo.CustomerChargeDept    = cInfo.CompetentDepartment;
                ordersInfo.CustomerExecutiveDept = cInfo.ExecutiveDepartment;
                ordersInfo.CustomerMainBusiness  = cInfo.MainBusiness;
                ordersInfo.CustomerProfiles      = cInfo.CustomerProfiles;
                ordersInfo.CustomerUseDept       = cInfo.UseDepartment;
                ordersInfo.CustomerZipCode       = cInfo.Zip;
                ordersInfo.Customer_Type         = cInfo.CustomerNatureName;
                ordersInfo.Customer_Type2        = cInfo.CustomerNatureName2;
                ordersInfo.Customer_Memo         = cInfo.Remark;
                ordersInfo.CustomerNo            = cInfo.EnterpriseCode;
            }

            if (oInfo.ToExamineState > 0)
            {
                ordersInfo.CustomerContact = customer.GetListByOrdersID(ordersInfo.PKID);
            }
            else
            {
                ordersInfo.CustomerContact = customer.GetListByCustomerID(ordersInfo.CustomerID);
            }

            if (viewOriginal)
            {
                BLL.CarPurchase cdBll = new CarPurchase();
                ordersInfo.CarPurchase = cdBll.GetOriginalList(ordersInfo.Code.Substring(0, ordersInfo.Code.IndexOf('.')));
            }
            else
            {
                BLL.CarPurchase cdBll = new CarPurchase();
                ordersInfo.CarPurchase = cdBll.GetList(ordersInfo.PKID);
            }

            // 经销店联系人
            BLL.DealerContact dcBLL = new DealerContact();
            if (oInfo.ToExamineState > 0)
            {
                ordersInfo.DealerContact = dcBLL.GetListByOrdersID(ordersInfo.PKID);
            }
            else
            {
                ordersInfo.DealerContact = dcBLL.GetListByDealerID(ordersInfo.DealerID);
            }

            return(ordersInfo);
        }