示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                userid = BLL.Util.GetLoginUserID();
                model  = BLL.YTGActivityTask.Instance.GetComAdoInfo <YTGActivityTaskInfo>(TaskID);

                if (model == null)
                {
                    #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
                {
                    if (model.Sex.HasValue)
                    {
                        string strSex = model.Sex.Value.ToString();
                        if (strSex == "1")
                        {
                            strSex = "先生";
                        }
                        else if (strSex == "2")
                        {
                            strSex = "女士";
                        }
                        else
                        {
                            strSex = "";
                        }
                        spanSex.InnerText = strSex;
                    }
                    if (model.ProvinceID.HasValue)
                    {
                        spanXiDanArea.InnerText += BitAuto.YanFa.Crm2009.BLL.AreaInfo.Instance.GetAreaName(model.ProvinceID.Value.ToString());
                    }
                    if (model.CityID.HasValue)
                    {
                        spanXiDanArea.InnerText += "  " + BitAuto.YanFa.Crm2009.BLL.AreaInfo.Instance.GetAreaName(model.CityID.Value.ToString());
                    }
                    if (model.ValueOrDefault_OrderCreateTime > (new DateTime(1900, 01, 01)))
                    {
                        spanXiDanDate.InnerText = model.ValueOrDefault_OrderCreateTime.ToString("yyyy-MM-dd");
                    }
                    if (model.TestDriveProvinceID.HasValue)
                    {
                        spanShiJiaArea.InnerText += BitAuto.YanFa.Crm2009.BLL.AreaInfo.Instance.GetAreaName(model.TestDriveProvinceID.Value.ToString());
                    }
                    if (model.TestDriveCityID.HasValue)
                    {
                        spanShiJiaArea.InnerText += "  " + BitAuto.YanFa.Crm2009.BLL.AreaInfo.Instance.GetAreaName(model.TestDriveCityID.Value.ToString());
                    }
                    //意向车型
                    spanYiXiangCheXing.InnerText = GetYiXiangCheXing();
                    spanPredictBuyTime.InnerText = GetPredictBuyTime();
                    if (model.IsSuccess.HasValue)
                    {
                        string strIsSuccess = model.IsSuccess.Value.ToString();
                        isSuccess = model.IsSuccess.Value;
                        if (strIsSuccess == "1")
                        {
                            strIsSuccess = "是";
                        }
                        else if (strIsSuccess == "0")
                        {
                            strIsSuccess = "否";
                        }
                        else
                        {
                            strIsSuccess = "";
                        }
                        spanIsSuccess.InnerText = strIsSuccess;
                    }

                    if (model.IsJT.HasValue)
                    {
                        string strIsJT = model.IsJT.Value.ToString();
                        if (strIsJT == "1")
                        {
                            strIsJT = "是";
                        }
                        else if (strIsJT == "0")
                        {
                            strIsJT = "否";
                        }
                        else
                        {
                            strIsJT = "";
                        }
                        spanIsConnected.InnerText = strIsJT;
                    }
                    spanFailReason.InnerText = GetFailReason();

                    spanRemark.InnerText = model.Remark;
                }
            }
        }
示例#2
0
        /// <summary>
        /// ordertype 1是保存,2是提交
        /// </summary>
        /// <param name="ordertype"></param>
        protected void DealTask(int ordertype, out string msg)
        {
            msg = "";
            if (!string.IsNullOrEmpty(RequestTaskID))
            {
                Entities.YTGActivityTaskInfo model = BLL.YTGActivityTask.Instance.GetComAdoInfo <YTGActivityTaskInfo>(RequestTaskID);
                if (model != null)
                {
                    if (model.Status != (int)Entities.YTGActivityTaskStatus.Processing && model.Status != (int)Entities.YTGActivityTaskStatus.NoProcess)
                    {
                        #region 如果任务被撤销任然保存任务,魏淑珍要求的
                        if (model.Status == (int)Entities.LeadsTaskStatus.ReBack)
                        {
                            model.LastUpdateTime   = System.DateTime.Now;
                            model.LastUpdateUserID = BLL.Util.GetLoginUserID();;

                            //姓名
                            model.UserName = RequestUserName;

                            //性别
                            model.Sex = CommonFunction.ObjectToInteger(RequestSex, -2);

                            //试驾省
                            model.TestDriveProvinceID = CommonFunction.ObjectToInteger(RequestTestDriveProvinceID, -1);

                            //试驾城市
                            model.TestDriveCityID = CommonFunction.ObjectToInteger(RequestTestDriveCityID, -1);

                            //意向车型
                            model.DCarSerialID = CommonFunction.ObjectToInteger(RequestDCarSerialID, -2);

                            //预计购车时间
                            model.PBuyCarTime = CommonFunction.ObjectToInteger(RequestPBuyCarTime, -2);

                            //是否成功
                            model.IsSuccess = CommonFunction.ObjectToInteger(RequestIsSuccess, -2);

                            //失败原因
                            model.FailReason = CommonFunction.ObjectToInteger(RequestFailReason, -2);

                            //是否接通
                            model.IsJT = CommonFunction.ObjectToInteger(RequestIsJT, -2);

                            //备注信息
                            model.Remark = RequestRemark;

                            //更新任务信息
                            try
                            {
                                BLL.YTGActivityTask.Instance.UpdateComAdoInfo(model);
                            }
                            catch (Exception ex)
                            {
                                BLL.Loger.Log4Net.Info("被撤销的任务更新任务信息失败:" + ex.Message);
                            }
                        }
                        msg = "{\"Result\":false,\"Msg\":\"任务不处于处理状态!\"}";
                        #endregion
                    }
                    else
                    {
                        #region 保存或提交订单信息,修改任务状态,插入任务操作状态
                        model.LastUpdateTime   = System.DateTime.Now;
                        model.LastUpdateUserID = BLL.Util.GetLoginUserID();

                        //姓名
                        model.UserName = RequestUserName;

                        //性别
                        model.Sex = CommonFunction.ObjectToInteger(RequestSex, -2);

                        //试驾省
                        model.TestDriveProvinceID = CommonFunction.ObjectToInteger(RequestTestDriveProvinceID, -1);

                        //试驾城市
                        model.TestDriveCityID = CommonFunction.ObjectToInteger(RequestTestDriveCityID, -1);

                        //意向车型
                        model.DCarSerialID = CommonFunction.ObjectToInteger(RequestDCarSerialID, -2);

                        //预计购车时间
                        model.PBuyCarTime = CommonFunction.ObjectToInteger(RequestPBuyCarTime, -2);

                        //是否成功
                        model.IsSuccess = CommonFunction.ObjectToInteger(RequestIsSuccess, -2);

                        //失败原因
                        model.FailReason = CommonFunction.ObjectToInteger(RequestFailReason, -2);

                        //是否接通
                        model.IsJT = CommonFunction.ObjectToInteger(RequestIsJT, -2);

                        //备注信息
                        model.Remark = RequestRemark;

                        //保存
                        if (ordertype == 1)
                        {
                            model.Status = (int)Entities.YTGActivityTaskStatus.Processing;
                        }
                        //提交
                        else if (ordertype == 2)
                        {
                            model.Status = (int)Entities.YTGActivityTaskStatus.Processed;
                        }

                        //更新任务信息
                        bool blSuccess = false;
                        try
                        {
                            blSuccess = BLL.YTGActivityTask.Instance.UpdateComAdoInfo <Entities.YTGActivityTaskInfo>(model);
                        }
                        catch (Exception ex)
                        {
                            BLL.Loger.Log4Net.Info("更新任务信息失败:" + ex.Message);
                            msg = "{\"Result\":false,\"Msg\":\"更新任务信息失败!\"}";
                        }

                        //插入任务操作日志
                        DealLog(ordertype);
                        #endregion

                        #region 提交处理
                        if (ordertype == 2)
                        {
                            #region 写入要回传的数据
                            Entities.YTGCallResultNoticeInfo resultNoticeModel = new Entities.YTGCallResultNoticeInfo();
                            if (blSuccess)
                            {
                                resultNoticeModel.TaskID     = RequestTaskID;
                                resultNoticeModel.Status     = 0;
                                resultNoticeModel.CreateTime = DateTime.Now;
                                try
                                {
                                    BLL.YTGCallResultNotice.Instance.InsertComAdoInfo <Entities.YTGCallResultNoticeInfo>(resultNoticeModel);
                                }
                                catch (Exception ex)
                                {
                                    BLL.Loger.Log4Net.Info("写入回传数据失败:" + ex.Message);
                                    msg = "{\"Result\":false,\"Msg\":\"写入回传数据失败!\"}";
                                }
                            }
                            #endregion
                        }
                        #endregion
                    }
                }
                else
                {
                    msg = "{\"Result\":false,\"Msg\":\"任务不存在!\"}";
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                userid = BLL.Util.GetLoginUserID();
                //增加“易团购--邀约处理”处理功能验证逻辑
                if (BLL.Util.CheckRight(userid, "SYS024MOD101505"))
                {
                    model = BLL.YTGActivityTask.Instance.GetComAdoInfo <YTGActivityTaskInfo>(TaskID);

                    if (model == null)
                    {
                        #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
                    {
                        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 if (model.Status != (int)Entities.YTGActivityTaskStatus.Processing && model.Status != (int)Entities.YTGActivityTaskStatus.NoProcess)
                        {
                            #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
                        {
                            if (model.Sex.HasValue)
                            {
                                sexValue = model.Sex.Value;
                            }
                            if (model.IsSuccess.HasValue)
                            {
                                isSuccess = model.IsSuccess.Value;
                            }
                            if (model.IsJT.HasValue)
                            {
                                isConnected = model.IsJT.Value;
                            }
                            if (model.ProvinceID.HasValue)
                            {
                                provinceID = model.ProvinceID.Value;
                            }
                            if (model.CityID.HasValue)
                            {
                                cityID = model.CityID.Value;
                            }
                            if (model.TestDriveProvinceID.HasValue)
                            {
                                testDriveProvinceID = model.TestDriveProvinceID.Value;
                            }
                            if (model.TestDriveCityID.HasValue)
                            {
                                testDriveCityID = model.TestDriveCityID.Value;
                            }
                            this.Remark.Value = model.Remark;

                            BindYiXiangCheXing(model.ActivityID);
                            BindPredictBuyTime();
                            BindFailReason();
                        }
                    }
                }
                else
                {
                    Response.Write(BLL.Util.GetNotAccessMsgPage("您没有访问该页面的权限"));
                    Response.End();
                }
            }
        }