private void CustBaseInfoBind() { Entities.GroupOrder custBasicInfo = BLL.GroupOrder.Instance.GetGroupOrderCustInfo(RequestTaskID); if (custBasicInfo != null) { CustName = custBasicInfo.CustomerName; if (custBasicInfo.UserGender == 1) { Sex = "先生"; } else if (custBasicInfo.UserGender == 2) { Sex = "女士"; } if (custBasicInfo.ProvinceID != Entities.Constants.Constant.INT_INVALID_VALUE) { PlaceStr += BitAuto.YanFa.Crm2009.BLL.AreaInfo.Instance.GetAreaName(custBasicInfo.ProvinceID.ToString()); } if (custBasicInfo.CityID != Entities.Constants.Constant.INT_INVALID_VALUE) { PlaceStr += " " + BitAuto.YanFa.Crm2009.BLL.AreaInfo.Instance.GetAreaName(custBasicInfo.CityID.ToString()); } //大区查询 强斐 2014-12-17 BitAuto.YanFa.Crm2009.Entities.AreaInfo info = BLL.Util.GetAreaInfoByPCC( BitAuto.ISDC.CC2012.Entities.CommonFunction.ObjectToString(custBasicInfo.ProvinceID), BitAuto.ISDC.CC2012.Entities.CommonFunction.ObjectToString(custBasicInfo.CityID), null); AreaStr = info == null ? "" : info.DistinctName; Tels = custBasicInfo.CustomerTel; lblUserName.Text = custBasicInfo.UserName; } }
private void CustBaseInfoBind() { Entities.GroupOrder custBasicInfo = BLL.GroupOrder.Instance.GetGroupOrderCustInfo(RequestTaskID); if (custBasicInfo != null) { CustName = custBasicInfo.CustomerName; if (custBasicInfo.UserGender == 1) { Sex = "先生"; } else if (custBasicInfo.UserGender == 2) { Sex = "女士"; } if (custBasicInfo.ProvinceID != Entities.Constants.Constant.INT_INVALID_VALUE) { PlaceStr += BitAuto.YanFa.Crm2009.BLL.AreaInfo.Instance.GetAreaName(custBasicInfo.ProvinceID.ToString()); } if (custBasicInfo.CityID != Entities.Constants.Constant.INT_INVALID_VALUE) { PlaceStr += " " + BitAuto.YanFa.Crm2009.BLL.AreaInfo.Instance.GetAreaName(custBasicInfo.CityID.ToString()); } AreaStr = BLL.Util.GetEnumOptText(typeof(Entities.EnumArea), (int)custBasicInfo.AreaID); Tels = custBasicInfo.CustomerTel; lblUserName.Text = custBasicInfo.UserName; } }
/// <summary> /// 根据易湃团购订单实体信息,插入表GroupOrder信息 /// </summary> /// <param name="tran"></param> /// <param name="taskID">任务ID</param> /// <param name="model">易湃团购订单实体信息</param> /// <returns></returns> public bool InsertByTaskID(SqlTransaction tran, long taskID, Entities.GroupOrderOrg model) { Entities.GroupOrder onModel = new Entities.GroupOrder(); onModel.TaskID = taskID; onModel.OrderID = model.OrderID; onModel.OrderCode = model.OrderCode; onModel.CustomerName = model.CustomerName.Trim(); onModel.CustomerTel = model.CustomerTel.Trim(); onModel.ProvinceID = model.ProvinceID; onModel.ProvinceName = model.ProvinceName; onModel.CityID = model.CityID; onModel.CityName = model.CityName; //修改大区 强斐 2014-12-17 BitAuto.YanFa.Crm2009.Entities.AreaInfo info = Util.GetAreaInfoByPCC( CommonFunction.ObjectToString(model.ProvinceID), CommonFunction.ObjectToString(model.CityID), null); onModel.AreaID = info == null ? "" : info.District; onModel.OrderCreateTime = model.OrderCreateTime; onModel.CarMasterID = model.CarMasterID; onModel.CarMasterName = model.CarMasterName; onModel.CarSerialID = model.CarSerialID; onModel.CarSerialName = model.CarSerialName; onModel.CarID = model.CarID; onModel.CarName = model.CarName; onModel.DealerID = model.DealerID; onModel.DealerName = model.DealerName; onModel.OrderPrice = model.Price; onModel.CreateTime = DateTime.Now; onModel.CreateUserID = null; onModel.LastUpdateTime = null; onModel.LastUpdateUserID = null; onModel.UserName = null; long recid = Insert(tran, onModel); if (recid > 0) { BLL.Loger.Log4Net.Info(string.Format("团购任务生成表GroupOrder成功,主键ID为:{0},无主订单ID为:{1},车款ID:{2},子品牌ID:{3},主品牌ID为:{4}", recid, onModel.OrderID, onModel.CarID == null ? 0 : onModel.CarID.Value, onModel.CarSerialID == null ? 0 : onModel.CarSerialID.Value, onModel.CarMasterID == null ? 0 : onModel.CarMasterID.Value )); return(true); } return(false); }
/// <summary> /// 在个人基本信息表中添加一个个人信息 /// </summary> /// <param name="groupordermodel"></param> /// <returns></returns> private string AddNewCustBaseInfo(Entities.GroupOrder groupordermodel) { string CustID = ""; #region 插入客户池 Entities.CustBasicInfo newcustmodel = new Entities.CustBasicInfo(); newcustmodel.Status = 0; newcustmodel.Sex = groupordermodel.UserGender; newcustmodel.CustName = groupordermodel.CustomerName; newcustmodel.CustCategoryID = 4; newcustmodel.ProvinceID = groupordermodel.ProvinceID; newcustmodel.CityID = groupordermodel.CityID; newcustmodel.AreaID = groupordermodel.AreaID; newcustmodel.CreateTime = System.DateTime.Now; newcustmodel.CreateUserID = userId; //功能废弃 插入客户基本信息 废弃 CustID = null;// BLL.CustBasicInfo.Instance.Insert(newcustmodel); Entities.CustTel custtelmodel = new Entities.CustTel(); custtelmodel.CreateTime = System.DateTime.Now; custtelmodel.CreateUserID = userId; custtelmodel.CustID = CustID; custtelmodel.Tel = groupordermodel.CustomerTel; //插入电话 BLL.CustTel.Instance.Insert(custtelmodel); //插入bugcarinfo Entities.BuyCarInfo bugcarmodel = new Entities.BuyCarInfo(); bugcarmodel.CustID = CustID; bugcarmodel.Type = 4; bugcarmodel.CarBrandId = 0; bugcarmodel.CarSerialId = 0; bugcarmodel.CarTypeID = 0; bugcarmodel.Status = 0; bugcarmodel.CreateTime = System.DateTime.Now; bugcarmodel.CreateUserID = userId; bugcarmodel.UserName = RequestQCTUserName; BLL.BuyCarInfo.Instance.Insert(bugcarmodel); #endregion return(CustID); }
/// <summary> /// ordertype 1是保存,2是提交 /// </summary> /// <param name="ordertype"></param> protected void DealOrder(int ordertype, out string msg) { msg = ""; long taskid = 0; if (long.TryParse(RequestTaskID, out taskid)) { Entities.GroupOrderTask model = BLL.GroupOrderTask.Instance.GetGroupOrderTask(taskid); if (model != null) { if (model.TaskStatus != (int)Entities.GroupTaskStatus.Processing && model.TaskStatus != (int)Entities.GroupTaskStatus.NoProcess) { msg = "{\"Result\":false,\"Msg\":\"任务不处于处理状态!\"}"; } else { //本地保存订单信息,修改订单状态 Entities.GroupOrder groupordermodel = BLL.GroupOrder.Instance.GetGroupOrder(taskid); if (groupordermodel != null) { #region 保存或提交订单信息,修改任务状态,插入任务操作状态 //保存 if (ordertype == 1) { model.LastUpdateTime = System.DateTime.Now; model.LastUpdateUserID = userId; model.TaskStatus = (int)Entities.GroupTaskStatus.Processing; } //提交 else if (ordertype == 2) { model.LastUpdateTime = System.DateTime.Now; model.LastUpdateUserID = userId; model.TaskStatus = (int)Entities.GroupTaskStatus.Processed; model.SubmitTime = System.DateTime.Now; } int IsReturnVisit = 0; if (int.TryParse(RequestIsReturnVisit, out IsReturnVisit)) { groupordermodel.IsReturnVisit = IsReturnVisit; } int FailReson = 0; if (int.TryParse(RequestFailReson, out FailReson)) { groupordermodel.FailReasonID = FailReson; } int sex = 0; if (int.TryParse(RequestSex, out sex)) { groupordermodel.UserGender = sex; } groupordermodel.CallRecord = RequestRemark; groupordermodel.UserName = RequestQCTUserName; groupordermodel.LastUpdateTime = System.DateTime.Now; groupordermodel.LastUpdateUserID = userId; //意向车型,预计购车时间 int _WantCarMasterID = -2; if (int.TryParse(WantCarMasterID, out _WantCarMasterID)) { groupordermodel.WantCarMasterID = _WantCarMasterID; } int _WantCarSerialID = -2; if (int.TryParse(WantCarSerialID, out _WantCarSerialID)) { groupordermodel.WantCarSerialID = _WantCarSerialID; } int _WantCarID = -2; if (int.TryParse(WantCarID, out _WantCarID)) { groupordermodel.WantCarID = _WantCarID; } int _PlanBuyCarTime = -2; if (int.TryParse(PlanBuyCarTime, out _PlanBuyCarTime)) { groupordermodel.PlanBuyCarTime = _PlanBuyCarTime; } groupordermodel.WantCarMasterName = WantCarMasterName; groupordermodel.WantCarSerialName = WantCarSerialName; groupordermodel.WantCarName = WantCarName; //更新任务状态 BLL.GroupOrderTask.Instance.Update(model); //对于保存不用匹配客户池客户所以在此处更新订单信息,提交要在匹配客户池客户后拿到custid后更新 if (ordertype == 1) { BLL.GroupOrder.Instance.Update(groupordermodel); } //插入或合并任务操作日志 DealLog(ordertype); #endregion #region 提交处理 if (ordertype == 2) { if (!string.IsNullOrEmpty(groupordermodel.CustomerTel)) { #region 根据电话号码判断 客户池是否存在,存在不更新客户,不存在插入 string CustID = string.Empty; //根据电话找客户,如果有多个去匹配那个名称一致的 DataTable dtcust = BLL.CustBasicInfo.Instance.GetCustBasicInfosByTel(groupordermodel.CustomerTel); if (dtcust != null && dtcust.Rows.Count > 0) { if (dtcust.Rows.Count == 1) { //如果找到一个,就取CustID CustID = dtcust.Rows[0]["CustID"].ToString(); } else if (dtcust.Rows.Count > 1) { //多个客户,查找有团购订单类型的客户 DataRow[] rows = dtcust.Select("CustName='" + groupordermodel.CustomerName.Trim() + "'"); if (rows.Length > 0) { CustID = rows[0]["CustID"].ToString(); } } } else { //根据电话没有找到客户,要插入个人客户信息表 CustID = AddNewCustBaseInfo(groupordermodel); } #endregion #region 提交要匹配客户池客户所以在匹配客户池客户后拿到custid后更新订单 groupordermodel.CustID = CustID; BLL.GroupOrder.Instance.Update(groupordermodel); #endregion #region 在客户历史记录里加入团购订单联系记录 Entities.CustHistoryInfo custhistroyinfomodel = new Entities.CustHistoryInfo(); custhistroyinfomodel.TaskID = RequestTaskID; //业务类型,2为团购订单 custhistroyinfomodel.BusinessType = 2; //录音 if (!string.IsNullOrEmpty(RequestCallRecordID)) { long callrecordid = 0; if (long.TryParse(RequestCallRecordID, out callrecordid)) { custhistroyinfomodel.CallRecordID = callrecordid; } } //呼出 custhistroyinfomodel.RecordType = 2; custhistroyinfomodel.CustID = CustID; custhistroyinfomodel.CreateTime = System.DateTime.Now; custhistroyinfomodel.CreateUserID = userId; //功能废弃 BLL.CustHistoryInfo.Instance.Insert(custhistroyinfomodel); #endregion #region 回写易湃 string errMsg = ""; ReWriteOrderData(taskid, out errMsg); #endregion if (errMsg != "") { msg = "{\"Result\":false,\"Msg\":\"调用易湃接口失败!" + errMsg + "\"}"; } } } #endregion } else { msg = "{\"Result\":false,\"Msg\":\"任务对应订单不存在!\"}"; } } } else { msg = "{\"Result\":false,\"Msg\":\"任务不存在!\"}"; } } }
/// <summary> /// ordertype 1是保存,2是提交 /// </summary> /// <param name="ordertype"></param> public void DealOrder(int ordertype, out string msg) { msg = ""; long taskid = 0; if (long.TryParse(RequestTaskID, out taskid)) { Entities.GroupOrderTask model = BLL.GroupOrderTask.Instance.GetGroupOrderTask(taskid); if (model != null) { if (model.TaskStatus != (int)Entities.GroupTaskStatus.NoAllocation && model.TaskStatus != (int)Entities.GroupTaskStatus.Processing && model.TaskStatus != (int)Entities.GroupTaskStatus.NoProcess) { //msg = "{\"Result\":false,\"Msg\":\"任务ID"+ taskid +"不处于处理状态\"}"; string s = ""; s = BitAuto.ISDC.CC2012.BLL.Util.GetEnumOptText(typeof(BitAuto.ISDC.CC2012.Entities.GroupTaskStatus), Convert.ToInt32(model.TaskStatus)); msg = "任务状态为:" + s + ",不处于处理状态"; } else { //本地保存订单信息,修改订单状态 Entities.GroupOrder groupordermodel = BLL.GroupOrder.Instance.GetGroupOrder(taskid); if (groupordermodel != null) { #region 保存或提交订单信息,修改任务状态,插入任务操作状态 //保存 if (ordertype == 1) { model.LastUpdateTime = System.DateTime.Now; model.LastUpdateUserID = userId; model.TaskStatus = (int)Entities.GroupTaskStatus.Processing; } //提交 else if (ordertype == 2) { model.LastUpdateTime = System.DateTime.Now; model.LastUpdateUserID = userId; //如果 是否为回访值为:是,则更新任务状态,调回写接口 //否则 不更新,也不调回写接口 if (this.RequestIsReturnVisit == ((int)Entities.IsReturnVisit.Yes).ToString()) { model.TaskStatus = (int)Entities.GroupTaskStatus.Processed; } model.SubmitTime = System.DateTime.Now; } int IsReturnVisit = 0; if (int.TryParse(RequestIsReturnVisit, out IsReturnVisit)) { groupordermodel.IsReturnVisit = IsReturnVisit; } groupordermodel.LastUpdateTime = System.DateTime.Now; groupordermodel.LastUpdateUserID = userId; //更新任务状态 BLL.GroupOrderTask.Instance.Update(model); //对于保存不用匹配客户池客户所以在此处更新订单信息,提交要在匹配客户池客户后拿到custid后更新 //处理结果为:否的,不提交,所以在些更新订单 //if (ordertype == 1) if (this.RequestIsReturnVisit == ((int)Entities.IsReturnVisit.No).ToString()) { BLL.GroupOrder.Instance.Update(groupordermodel); } //插入或合并任务操作日志 //如果 是否为回访值为:是,则更新任务状态,调回写接口 //否则 不更新,也不调回写接口 if (this.RequestIsReturnVisit == ((int)Entities.IsReturnVisit.Yes).ToString()) { DealLog(ordertype); } #endregion //如果 是否为回访值为:是,则更新任务状态,调回写接口 //否则 不更新,也不调回写接口 #region 提交处理 if (ordertype == 2 && this.RequestIsReturnVisit == ((int)Entities.IsReturnVisit.Yes).ToString()) { if (!string.IsNullOrEmpty(groupordermodel.CustomerTel)) { #region 根据电话号码判断 客户池是否存在,存在不更新客户,不存在插入 string CustID = string.Empty; //根据电话找客户,如果有多个去匹配那个名称一致的 DataTable dtcust = BLL.CustBasicInfo.Instance.GetCustBasicInfosByTel(groupordermodel.CustomerTel); if (dtcust != null && dtcust.Rows.Count > 0) { for (int i = 0; i < dtcust.Rows.Count; i++) { if (dtcust.Rows[i]["CustName"].ToString() == groupordermodel.CustomerName) { CustID = dtcust.Rows[i]["CustID"].ToString(); break; } } } //如果CustID不为空说明找到了,否则没找到 if (!string.IsNullOrEmpty(CustID)) { } else { #region 插入客户池 Entities.CustBasicInfo newcustmodel = new Entities.CustBasicInfo(); newcustmodel.Status = 0; newcustmodel.Sex = groupordermodel.UserGender; newcustmodel.CustName = groupordermodel.CustomerName; newcustmodel.CustCategoryID = 4; newcustmodel.ProvinceID = groupordermodel.ProvinceID; newcustmodel.CityID = groupordermodel.CityID; newcustmodel.AreaID = groupordermodel.AreaID; newcustmodel.CreateTime = System.DateTime.Now; newcustmodel.CreateUserID = userId; //功能废弃 插入客户基本信息 CustID = null;// BLL.CustBasicInfo.Instance.Insert(newcustmodel); Entities.CustTel custtelmodel = new Entities.CustTel(); custtelmodel.CreateTime = System.DateTime.Now; custtelmodel.CreateUserID = userId; custtelmodel.CustID = CustID; custtelmodel.Tel = groupordermodel.CustomerTel; //插入电话 BLL.CustTel.Instance.Insert(custtelmodel); //插入bugcarinfo Entities.BuyCarInfo bugcarmodel = new Entities.BuyCarInfo(); bugcarmodel.CustID = CustID; bugcarmodel.Type = 4; bugcarmodel.CarBrandId = 0; bugcarmodel.CarSerialId = 0; bugcarmodel.CarTypeID = 0; bugcarmodel.Status = 0; bugcarmodel.CreateTime = System.DateTime.Now; bugcarmodel.CreateUserID = userId; //bugcarmodel.UserName = RequestQCTUserName; BLL.BuyCarInfo.Instance.Insert(bugcarmodel); #endregion } #endregion #region 提交要匹配客户池客户所以在匹配客户池客户后拿到custid后更新订单 groupordermodel.CustID = CustID; BLL.GroupOrder.Instance.Update(groupordermodel); #endregion #region 在客户历史记录里加入团购订单联系记录 Entities.CustHistoryInfo custhistroyinfomodel = new Entities.CustHistoryInfo(); custhistroyinfomodel.TaskID = RequestTaskID; //业务类型,2为团购订单 custhistroyinfomodel.BusinessType = 2; //录音 //if (!string.IsNullOrEmpty(RequestCallRecordID)) //{ // long callrecordid = 0; // if (long.TryParse(RequestCallRecordID, out callrecordid)) // { // custhistroyinfomodel.CallRecordID = callrecordid; // } //} //呼出 custhistroyinfomodel.RecordType = 2; custhistroyinfomodel.CustID = CustID; custhistroyinfomodel.CreateTime = System.DateTime.Now; custhistroyinfomodel.CreateUserID = userId; //功能废弃 BLL.CustHistoryInfo.Instance.Insert(custhistroyinfomodel); #endregion #region 回写易湃 ReWriteOrderData(taskid); #endregion } } #endregion } else { //msg = "{\"Result\":false,\"Msg\":\"任务ID" + taskid + "对应订单不存在!\"}"; msg = "对应订单不存在!"; } } } else { //msg = "{\"Result\":false,\"Msg\":\"任务ID" + taskid + "不存在!\"}"; msg = "任务ID不存在"; } } }
private void OrderInfoBind() { Entities.GroupOrder custBasicInfo = BLL.GroupOrder.Instance.GetGroupOrderCustInfo(RequestTaskID); if (custBasicInfo != null) { int _userID = BLL.Util.GetLoginUserID(); if (custBasicInfo.AssignUserID == _userID) { IsBelong = "1"; } // if (IsEditTask == "0" && IsBelong == "0") // { // Response.Write(@"<script language='javascript'>alert('此订单不是您处理的且无管理员查看权限,无法查看。');try { // window.external.MethodScript('/browsercontrol/closepagereloadppage'); // } // catch (e) { // window.opener = null; window.open('', '_self'); window.close(); // }</script>"); // } OrderCode = custBasicInfo.OrderCode.ToString(); DealerID = custBasicInfo.DealerID.ToString(); //根据经销商id,取名称 if (!string.IsNullOrEmpty(DealerID) && DealerID != "0" && DealerID != "-2") { BitAuto.YanFa.Crm2009.Entities.DMSMember DMSModel = BitAuto.YanFa.Crm2009.BLL.DMSMember.Instance.GetDMSMemberByMemberCode(DealerID); if (DMSModel != null) { MemberID = DMSModel.ID.ToString(); CustID = DMSModel.CustID; } } DealerName = custBasicInfo.DealerName; CarSerialName = custBasicInfo.CarMasterName + "-" + custBasicInfo.CarSerialName + "-" + custBasicInfo.CarName; if (!string.IsNullOrEmpty(custBasicInfo.WantCarMasterName)) { wantcarname += custBasicInfo.WantCarMasterName; } if (!string.IsNullOrEmpty(custBasicInfo.WantCarSerialName)) { if (!string.IsNullOrEmpty(wantcarname)) { wantcarname += "-" + custBasicInfo.WantCarSerialName; } else { wantcarname += custBasicInfo.WantCarSerialName; } } if (!string.IsNullOrEmpty(custBasicInfo.WantCarName)) { if (!string.IsNullOrEmpty(wantcarname)) { wantcarname += "-" + custBasicInfo.WantCarName; } else { wantcarname += custBasicInfo.WantCarName; } } if (custBasicInfo.PlanBuyCarTime != -2) { planbuycartime = BLL.Util.GetEnumOptText(typeof(Entities.GO_PlanBuyCarTime), Convert.ToInt32(custBasicInfo.PlanBuyCarTime)); } //CreateTime = custBasicInfo.CreateTime.ToString(); //下单时间 CreateTime = custBasicInfo.OrderCreateTime.ToString(); OrderPrice = custBasicInfo.OrderPrice.ToString() + "万元"; IsReturnVisit = BLL.Util.GetEnumOptText(typeof(Entities.IsReturnVisit), (int)custBasicInfo.IsReturnVisit); FailReason = custBasicInfo.FailReason; CallRecord = custBasicInfo.CallRecord; if (custBasicInfo.TaskStatus == (int)Entities.GroupTaskStatus.Processed) { IsProcessed = "1"; } } }
protected void Page_Load(object sender, EventArgs e) { #region 页面初次加载 if (!IsPostBack) { if (!string.IsNullOrEmpty(TaskID)) { #region 绑定失败理由 BindFailReson(); #endregion #region 绑定预计购车时间 BindPlanBuyCarTime(); #endregion #region 任务不为空 int TaskIDInt = 0; if (int.TryParse(TaskID, out TaskIDInt)) { #region 任务数据格式正确 Entities.GroupOrderTask model = GroupOrderTask.Instance.GetGroupOrderTask(TaskIDInt); if (model != null) { #region 任务存在 if (model.TaskStatus == (int)Entities.GroupTaskStatus.NoAllocation || model.TaskStatus == (int)Entities.GroupTaskStatus.Processed) { #region 任务不处于处理状态 Response.Write(@"<script language='javascript'>alert('当前任务不处于处理状态,页面将被关闭。');try { window.external.MethodScript('/browsercontrol/closepagereloadppage'); } catch (e) { window.opener = null; window.open('', '_self'); window.close(); }</script>"); #endregion } else { #region 任务处于处理状态 if (model.AssignUserID != BLL.Util.GetLoginUserID()) { #region 当前人不是处理人 Response.Write(@"<script language='javascript'>alert('您不是该任务的当前处理人,页面将被关闭。');try { window.external.MethodScript('/browsercontrol/closepagereloadppage'); } catch (e) { window.opener = null; window.open('', '_self'); window.close(); }</script>"); #endregion } else { #region 加载页面 Entities.GroupOrder grouporder = BLL.GroupOrder.Instance.GetGroupOrder(TaskIDInt); if (grouporder != null) { #region 订单存在 //客户名称 CustName = grouporder.CustomerName; //客户性别 if (grouporder.UserGender == 1) { rdoMan.Checked = true; } else if (grouporder.UserGender == 2) { rdoWomen.Checked = true; } //客户电话 CustTel = grouporder.CustomerTel; //客户城市id CityID = grouporder.CityID.ToString(); //客户省份ID ProvinceID = grouporder.ProvinceID.ToString(); //客户省份城市 if (!string.IsNullOrEmpty(grouporder.ProvinceName)) { LocationName += grouporder.ProvinceName + " "; } if (!string.IsNullOrEmpty(grouporder.CityName)) { LocationName += grouporder.CityName; } //大区id AreaID = grouporder.AreaID.ToString(); UserName = grouporder.UserName; //大区名称 //强斐 2014-12-17 BitAuto.YanFa.Crm2009.Entities.AreaInfo info = BLL.Util.GetAreaInfoByPCC( BitAuto.ISDC.CC2012.Entities.CommonFunction.ObjectToString(grouporder.ProvinceID), BitAuto.ISDC.CC2012.Entities.CommonFunction.ObjectToString(grouporder.CityID), null); AreaName = info == null ? "" : info.DistinctName; //订单ID OrderID = grouporder.OrderID.ToString(); //订单编号 OrderCode = grouporder.OrderCode.ToString(); //经销商id DealerID = grouporder.DealerID.ToString(); //根据经销商id,取名称 if (!string.IsNullOrEmpty(DealerID) && DealerID != "0" && DealerID != "-2") { BitAuto.YanFa.Crm2009.Entities.DMSMember DMSModel = BitAuto.YanFa.Crm2009.BLL.DMSMember.Instance.GetDMSMemberByMemberCode(DealerID); if (DMSModel != null) { MemberID = DMSModel.ID.ToString(); CustID = DMSModel.CustID; } } //经销商名称 DealerName = grouporder.DealerName; //车款名称 if (!string.IsNullOrEmpty(grouporder.CarMasterName)) { CarName += grouporder.CarMasterName; } if (!string.IsNullOrEmpty(grouporder.CarSerialName)) { CarName += "-" + grouporder.CarSerialName; } if (!string.IsNullOrEmpty(grouporder.CarName)) { CarName += "-" + grouporder.CarName; } //下单时间 DateTime ordertime = System.DateTime.Now; if (DateTime.TryParse(grouporder.OrderCreateTime.ToString(), out ordertime)) { OrderTime = ordertime.ToString("yyyy-MM-dd HH:mm:ss"); } else { OrderTime = ""; } //价格 OrderPrice = grouporder.OrderPrice + "万元"; //是否回访 selReturnVisit.SelectedIndex = selReturnVisit.Items.IndexOf(selReturnVisit.Items.FindByValue(grouporder.IsReturnVisit.ToString())); Remark = grouporder.CallRecord; //失败原因 selFailReson.SelectedIndex = selFailReson.Items.IndexOf(selFailReson.Items.FindByValue(grouporder.FailReasonID.ToString())); //加载意向车型 WantCarBrandID = grouporder.WantCarMasterID.ToString(); WantCarSerialID = grouporder.WantCarSerialID.ToString(); WantCarID = grouporder.WantCarID.ToString(); //预计购车时间 if (grouporder.PlanBuyCarTime != -2) { dllPlanBuyCarTime.SelectedIndex = dllPlanBuyCarTime.Items.IndexOf(dllPlanBuyCarTime.Items.FindByValue(grouporder.PlanBuyCarTime.ToString())); } #endregion } else { #region 订单不存在 Response.Write(@"<script language='javascript'>alert('该任务对应订单不存在,页面将被关闭。');try { window.external.MethodScript('/browsercontrol/closepagereloadppage'); } catch (e) { window.opener = null; window.open('', '_self'); window.close(); }</script>"); #endregion } #endregion } #endregion } #endregion } else { #region 任务不存在 Response.Write(@"<script language='javascript'>alert('任务不存在,页面将被关闭。');try { window.external.MethodScript('/browsercontrol/closepagereloadppage'); } catch (e) { window.opener = null; window.open('', '_self'); window.close(); }</script>"); #endregion } #endregion } else { #region 格式不正确 Response.Write(@"<script language='javascript'>alert('任务的数据格式不正确,页面将被关闭。');try { window.external.MethodScript('/browsercontrol/closepagereloadppage'); } catch (e) { window.opener = null; window.open('', '_self'); window.close(); }</script>"); #endregion } #endregion } else { #region 任务为空 Response.Write(@"<script language='javascript'>alert('任务不能为空,页面将被关闭。');try { window.external.MethodScript('/browsercontrol/closepagereloadppage'); } catch (e) { window.opener = null; window.open('', '_self'); window.close(); }</script>"); #endregion } } #endregion }
/// <summary> /// 更新一条数据 /// </summary> public int Update(SqlTransaction sqltran, Entities.GroupOrder model) { return(Dal.GroupOrder.Instance.Update(sqltran, model)); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(Entities.GroupOrder model) { return(Dal.GroupOrder.Instance.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public long Insert(SqlTransaction sqltran, Entities.GroupOrder model) { return(Dal.GroupOrder.Instance.Insert(sqltran, model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Insert(Entities.GroupOrder model) { Dal.GroupOrder.Instance.Insert(model); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(SqlTransaction sqltran, Entities.GroupOrder model) { SqlParameter[] parameters = { new SqlParameter("@TaskID", SqlDbType.BigInt, 8), new SqlParameter("@OrderID", SqlDbType.Int, 4), new SqlParameter("@OrderCode", SqlDbType.Int, 4), new SqlParameter("@CustomerName", SqlDbType.NVarChar, 100), new SqlParameter("@CustomerTel", SqlDbType.NVarChar, 50), new SqlParameter("@UserGender", SqlDbType.Int, 4), new SqlParameter("@ProvinceID", SqlDbType.Int, 4), new SqlParameter("@ProvinceName", SqlDbType.NVarChar, 100), new SqlParameter("@CityID", SqlDbType.Int, 4), new SqlParameter("@CityName", SqlDbType.NVarChar, 100), new SqlParameter("@AreaID", SqlDbType.VarChar, 50), new SqlParameter("@OrderCreateTime", SqlDbType.DateTime), new SqlParameter("@CarMasterID", SqlDbType.Int, 4), new SqlParameter("@CarMasterName", SqlDbType.NVarChar, 100), new SqlParameter("@CarSerialID", SqlDbType.Int, 4), new SqlParameter("@CarSerialName", SqlDbType.NVarChar, 100), new SqlParameter("@CarID", SqlDbType.Int, 4), new SqlParameter("@CarName", SqlDbType.NVarChar, 100), new SqlParameter("@DealerID", SqlDbType.Int, 4), new SqlParameter("@DealerName", SqlDbType.NVarChar, 100), new SqlParameter("@CallRecord", SqlDbType.NVarChar, 2000), new SqlParameter("@IsReturnVisit", SqlDbType.Int, 4), new SqlParameter("@OrderPrice", SqlDbType.Decimal, 9), new SqlParameter("@FailReasonID", SqlDbType.Int, 4), new SqlParameter("@CreateUserID", SqlDbType.Int, 4), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@LastUpdateTime", SqlDbType.DateTime), new SqlParameter("@LastUpdateUserID", SqlDbType.Int, 4), new SqlParameter("@UserName", SqlDbType.NVarChar, 200), new SqlParameter("@CustID", SqlDbType.VarChar, 20), new SqlParameter("@WantCarMasterID", SqlDbType.Int, 4), new SqlParameter("@WantCarSerialID", SqlDbType.Int, 4), new SqlParameter("@WantCarID", SqlDbType.Int, 4), new SqlParameter("@WantCarMasterName", SqlDbType.NVarChar, 100), new SqlParameter("@WantCarSerialName", SqlDbType.NVarChar, 100), new SqlParameter("@WantCarName", SqlDbType.NVarChar, 100), new SqlParameter("@PlanBuyCarTime", SqlDbType.Int, 4) }; parameters[0].Value = model.TaskID; parameters[1].Value = model.OrderID; parameters[2].Value = model.OrderCode; parameters[3].Value = model.CustomerName; parameters[4].Value = model.CustomerTel; parameters[5].Value = model.UserGender; parameters[6].Value = model.ProvinceID; parameters[7].Value = model.ProvinceName; parameters[8].Value = model.CityID; parameters[9].Value = model.CityName; parameters[10].Value = model.AreaID; parameters[11].Value = model.OrderCreateTime; parameters[12].Value = model.CarMasterID; parameters[13].Value = model.CarMasterName; parameters[14].Value = model.CarSerialID; parameters[15].Value = model.CarSerialName; parameters[16].Value = model.CarID; parameters[17].Value = model.CarName; parameters[18].Value = model.DealerID; parameters[19].Value = model.DealerName; parameters[20].Value = model.CallRecord; parameters[21].Value = model.IsReturnVisit; parameters[22].Value = model.OrderPrice; parameters[23].Value = model.FailReasonID; parameters[24].Value = model.CreateUserID; parameters[25].Value = model.CreateTime; parameters[26].Value = model.LastUpdateTime; parameters[27].Value = model.LastUpdateUserID; parameters[28].Value = model.UserName; parameters[29].Value = model.CustID; parameters[30].Value = model.WantCarMasterID; parameters[31].Value = model.WantCarSerialID; parameters[32].Value = model.WantCarID; parameters[33].Value = model.WantCarMasterName; parameters[34].Value = model.WantCarSerialName; parameters[35].Value = model.WantCarName; parameters[36].Value = model.PlanBuyCarTime; return(SqlHelper.ExecuteNonQuery(sqltran, CommandType.StoredProcedure, P_GROUPORDER_UPDATE, parameters)); }
private Entities.GroupOrder LoadSingleGroupOrder(DataRow row) { Entities.GroupOrder model = new Entities.GroupOrder(); if (row["TaskID"].ToString() != "") { model.TaskID = long.Parse(row["TaskID"].ToString()); } if (row["OrderID"].ToString() != "") { model.OrderID = int.Parse(row["OrderID"].ToString()); } if (row["OrderCode"].ToString() != "") { model.OrderCode = int.Parse(row["OrderCode"].ToString()); } model.CustomerName = row["CustomerName"].ToString(); model.CustomerTel = row["CustomerTel"].ToString(); if (row["UserGender"].ToString() != "") { model.UserGender = int.Parse(row["UserGender"].ToString()); } if (row["ProvinceID"].ToString() != "") { model.ProvinceID = int.Parse(row["ProvinceID"].ToString()); } model.ProvinceName = row["ProvinceName"].ToString(); if (row["CityID"].ToString() != "") { model.CityID = int.Parse(row["CityID"].ToString()); } model.CityName = row["CityName"].ToString(); if (row["AreaID"].ToString() != "") { model.AreaID = row["AreaID"].ToString(); //int.Parse(row["AreaID"].ToString()); } if (row["OrderCreateTime"].ToString() != "") { model.OrderCreateTime = DateTime.Parse(row["OrderCreateTime"].ToString()); } if (row["CarMasterID"].ToString() != "") { model.CarMasterID = int.Parse(row["CarMasterID"].ToString()); } model.CarMasterName = row["CarMasterName"].ToString(); if (row["CarSerialID"].ToString() != "") { model.CarSerialID = int.Parse(row["CarSerialID"].ToString()); } model.CarSerialName = row["CarSerialName"].ToString(); if (row["CarID"].ToString() != "") { model.CarID = int.Parse(row["CarID"].ToString()); } model.CarName = row["CarName"].ToString(); if (row["DealerID"].ToString() != "") { model.DealerID = int.Parse(row["DealerID"].ToString()); } model.DealerName = row["DealerName"].ToString(); model.CallRecord = row["CallRecord"].ToString(); if (row["IsReturnVisit"].ToString() != "") { model.IsReturnVisit = int.Parse(row["IsReturnVisit"].ToString()); } if (row["OrderPrice"].ToString() != "") { model.OrderPrice = decimal.Parse(row["OrderPrice"].ToString()); } if (row["FailReasonID"].ToString() != "") { model.FailReasonID = int.Parse(row["FailReasonID"].ToString()); } if (row["CreateUserID"].ToString() != "") { model.CreateUserID = int.Parse(row["CreateUserID"].ToString()); } if (row["CreateTime"].ToString() != "") { model.CreateTime = DateTime.Parse(row["CreateTime"].ToString()); } if (row["LastUpdateTime"].ToString() != "") { model.LastUpdateTime = DateTime.Parse(row["LastUpdateTime"].ToString()); } if (row["LastUpdateUserID"].ToString() != "") { model.LastUpdateUserID = int.Parse(row["LastUpdateUserID"].ToString()); } if (row["CustID"].ToString() != "") { model.CustID = row["CustID"].ToString(); } if (row["UserName"].ToString() != "") { model.UserName = row["UserName"].ToString(); } if (row["WantCarMasterID"].ToString() != "") { model.WantCarMasterID = int.Parse(row["WantCarMasterID"].ToString()); } if (row["WantCarSerialID"].ToString() != "") { model.WantCarSerialID = int.Parse(row["WantCarSerialID"].ToString()); } if (row["WantCarID"].ToString() != "") { model.WantCarID = int.Parse(row["WantCarID"].ToString()); } if (row["PlanBuyCarTime"].ToString() != "") { model.PlanBuyCarTime = int.Parse(row["PlanBuyCarTime"].ToString()); } if (row["WantCarMasterName"].ToString() != "") { model.WantCarMasterName = row["WantCarMasterName"].ToString(); } if (row["WantCarSerialName"].ToString() != "") { model.WantCarSerialName = row["WantCarSerialName"].ToString(); } if (row["WantCarName"].ToString() != "") { model.WantCarName = row["WantCarName"].ToString(); } return(model); }