Esempio n. 1
0
        public void getDC(HttpContext context)
        {
            List <Common.Entity.DealerContact>      dealerContactResult = new List <Common.Entity.DealerContact>();
            List <Common.Entity.OrderDealerContact> orderContactResult  = new List <Common.Entity.OrderDealerContact>();

            BLL.DealerContact dealerContact = new BLL.DealerContact();
            string            DealerId      = context.Request["DealerId"];
            string            orderId       = context.Request["orderId"];
            string            IsEdit        = context.Request["IsEdit"];

            if (!string.IsNullOrEmpty(DealerId))
            {
                if ("1" == IsEdit)
                {
                    dealerContactResult = dealerContact.GetListByDealerID(DealerId);
                    var model = new CommonFunction.DataResult <Common.Entity.DealerContact>
                    {
                        dataList = dealerContactResult
                    };
                    context.Response.Write(JsonConvert.SerializeObject(model));
                }
            }
            else
            {
                orderContactResult = dealerContact.GetListByOrdersID(orderId);
                var model = new CommonFunction.DataResult <Common.Entity.OrderDealerContact>
                {
                    dataList = orderContactResult
                };
                context.Response.Write(JsonConvert.SerializeObject(model));
            }
        }
Esempio n. 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);
        }