Exemplo n.º 1
0
 private void GetInfoByTaskID()
 {
     Entities.OrderCRMStopCustTaskInfo model_task = BLL.OrderCRMStopCustTask.Instance.GetOrderCRMStopCustTask(TaskID);
     if (model_task != null)
     {
         Entities.StopCustApply model_cust = BLL.StopCustApply.Instance.GetStopCustApply((int)model_task.RelationID);
         if (model_cust != null)
         {
             DeleteMemberID = model_cust.DeleteMemberID;
             CustID         = model_cust.CustID;
         }
     }
 }
Exemplo n.º 2
0
        public Entities.StopCustApply GetStopCustApplyByCrmStopCustApplyID(int CRMStopCustApplyID)
        {
            Entities.StopCustApply model = null;
            string sqlStr = "select * from StopCustApply where CRMStopCustApplyID=" + CRMStopCustApplyID;

            DataTable dt = SqlHelper.ExecuteDataset(CONNECTIONSTRINGS, CommandType.Text, sqlStr).Tables[0];

            if (dt != null && dt.Rows.Count > 0)
            {
                model = LoadSingleStopCustApply(dt.Rows[0]);
            }

            return(model);
        }
Exemplo n.º 3
0
        public static void InsertLogStopCustApply(Entities.StopCustApply oldModel, Entities.StopCustApply newModel, int userID)
        {
            string userLogStr = string.Empty;
            string logStr     = string.Empty;

            Hashtable ht_FieldName = new Hashtable();

            ht_FieldName.Add("ApplyerID", "申请人");
            ht_FieldName.Add("ApplyTime", "申请时间");
            ht_FieldName.Add("AuditTime", "审核时间");
            ht_FieldName.Add("StopTime", "停用时间");
            ht_FieldName.Add("StopStatus", "停用申请状态");
            ht_FieldName.Add("RejectReason", "驳回理由");
            ht_FieldName.Add("AuditOpinion", "审核意见");
            ht_FieldName.Add("Remark", "备注");
            ht_FieldName.Add("CreateUserID", "操作人");

            BLL.GetLogDesc.ht_FieldName = ht_FieldName;

            Hashtable ht_FieldType = new Hashtable();

            ht_FieldType.Add("ApplyerID", "UserID");
            ht_FieldType.Add("StopStatus", GetStopStatus());
            ht_FieldType.Add("CreateUserID", "UserID");

            BLL.GetLogDesc.ht_FieldType = ht_FieldType;

            if (oldModel == null)//为空,则是新增
            {
                //插入日志
                BLL.GetLogDesc.getAddLogInfo(newModel, out userLogStr);

                logStr = "CRM停用客户申请表新增:" + userLogStr;
            }
            else //不为空,则是编辑
            {
                //插入日志
                BLL.GetLogDesc.getCompareLogInfo(oldModel, newModel, out userLogStr);

                logStr = "CRM停用客户申请表编辑:" + userLogStr;
            }

            if (userLogStr != string.Empty)
            {
                InsertUserLog(logStr, userID);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public int Insert(Entities.StopCustApply model)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@RecID",              SqlDbType.Int,          4),
                new SqlParameter("@CRMStopCustApplyID", SqlDbType.Int,          4),
                new SqlParameter("@CustID",             SqlDbType.VarChar,     50),
                new SqlParameter("@ApplyerID",          SqlDbType.Int,          4),
                new SqlParameter("@AreaName",           SqlDbType.NVarChar,   100),
                new SqlParameter("@AreaID",             SqlDbType.Int,          4),
                new SqlParameter("@ApplyTime",          SqlDbType.DateTime),
                new SqlParameter("@AuditTime",          SqlDbType.DateTime),
                new SqlParameter("@StopTime",           SqlDbType.DateTime),
                new SqlParameter("@StopStatus",         SqlDbType.Int,          4),
                new SqlParameter("@RejectReason",       SqlDbType.NVarChar,  2000),
                new SqlParameter("@AuditOpinion",       SqlDbType.NVarChar,  2000),
                new SqlParameter("@Remark",             SqlDbType.NVarChar,  2000),
                new SqlParameter("@DeleteMemberID",     SqlDbType.VarChar,   2000),
                new SqlParameter("@ApplyType",          SqlDbType.Int,          4),
                new SqlParameter("@ApplyReason",        SqlDbType.Int,          4),
                new SqlParameter("@ApplyRemark",        SqlDbType.Int, 4)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.CRMStopCustApplyID;
            parameters[2].Value     = model.CustID;
            parameters[3].Value     = model.ApplyerID;
            parameters[4].Value     = model.AreaName;
            parameters[5].Value     = model.AreaID;
            parameters[6].Value     = model.ApplyTime;
            parameters[7].Value     = model.AuditTime;
            parameters[8].Value     = model.StopTime;
            parameters[9].Value     = model.StopStatus;
            parameters[10].Value    = model.RejectReason;
            parameters[11].Value    = model.AuditOpinion;
            parameters[12].Value    = model.Remark;
            parameters[13].Value    = model.DeleteMemberID;

            parameters[14].Value = model.ApplyType;
            parameters[15].Value = model.ApplyReason;
            parameters[16].Value = model.ApplyRemark;

            SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.StoredProcedure, P_STOPCUSTAPPLY_INSERT, parameters);
            return((int)parameters[0].Value);
        }
Exemplo n.º 5
0
        /// 插入主表 StopCustApply
        /// <summary>
        /// 插入主表 StopCustApply
        /// </summary>
        /// <param name="CRMStopCustApplyID"></param>
        /// <param name="CustID"></param>
        /// <param name="ApplyerID"></param>
        /// <param name="AreaName"></param>
        /// <param name="ApplyTime"></param>
        /// <param name="StopStatus"></param>
        /// <param name="Remark"></param>
        /// <param name="DeleteMemberID"></param>
        /// <param name="ApplyType"></param>
        /// <param name="ApplyReason"></param>
        /// <param name="ApplyRemark"></param>
        /// <returns></returns>
        private static int InsertStopCustApply(int CRMStopCustApplyID, string CustID, int ApplyerID, string AreaName, DateTime ApplyTime, int StopStatus, string Remark, string DeleteMemberID, int ApplyType, int ApplyReason, int ApplyRemark)
        {
            Entities.StopCustApply model = new Entities.StopCustApply();
            model.CRMStopCustApplyID = CRMStopCustApplyID;
            model.CustID             = CustID;
            model.ApplyerID          = ApplyerID;
            model.AreaName           = AreaName;
            model.ApplyTime          = ApplyTime;
            model.StopStatus         = StopStatus;
            model.Remark             = Remark;
            model.DeleteMemberID     = DeleteMemberID;
            model.ApplyType          = ApplyType;
            model.ApplyReason        = ApplyReason;
            model.ApplyRemark        = ApplyRemark;
            int recID = BLL.StopCustApply.Instance.Insert(model);

            //插入日志
            model.RecID = recID;
            return(recID);
        }
Exemplo n.º 6
0
 /// <summary>
 ///  更新一条数据
 /// </summary>
 public int Update(SqlTransaction sqltran, Entities.StopCustApply model)
 {
     SqlParameter[] parameters =
     {
         new SqlParameter("@RecID",              SqlDbType.Int,          4),
         new SqlParameter("@CRMStopCustApplyID", SqlDbType.Int,          4),
         new SqlParameter("@CustID",             SqlDbType.VarChar,     50),
         new SqlParameter("@ApplyerID",          SqlDbType.Int,          4),
         new SqlParameter("@AreaName",           SqlDbType.NVarChar,   100),
         new SqlParameter("@AreaID",             SqlDbType.Int,          4),
         new SqlParameter("@ApplyTime",          SqlDbType.DateTime),
         new SqlParameter("@AuditTime",          SqlDbType.DateTime),
         new SqlParameter("@StopTime",           SqlDbType.DateTime),
         new SqlParameter("@StopStatus",         SqlDbType.Int,          4),
         new SqlParameter("@RejectReason",       SqlDbType.NVarChar,  2000),
         new SqlParameter("@AuditOpinion",       SqlDbType.NVarChar,  2000),
         new SqlParameter("@Remark",             SqlDbType.NVarChar,  2000),
         new SqlParameter("@DeleteMemberID",     SqlDbType.VarChar,   2000),
         new SqlParameter("@ApplyType",          SqlDbType.Int,          4),
         new SqlParameter("@ApplyReason",        SqlDbType.Int,          4),
         new SqlParameter("@ApplyRemark",        SqlDbType.Int, 4)
     };
     parameters[0].Value  = model.RecID;
     parameters[1].Value  = model.CRMStopCustApplyID;
     parameters[2].Value  = model.CustID;
     parameters[3].Value  = model.ApplyerID;
     parameters[4].Value  = model.AreaName;
     parameters[5].Value  = model.AreaID;
     parameters[6].Value  = model.ApplyTime;
     parameters[7].Value  = model.AuditTime;
     parameters[8].Value  = model.StopTime;
     parameters[9].Value  = model.StopStatus;
     parameters[10].Value = model.RejectReason;
     parameters[11].Value = model.AuditOpinion;
     parameters[12].Value = model.Remark;
     parameters[13].Value = model.DeleteMemberID;
     parameters[14].Value = model.ApplyType;
     parameters[15].Value = model.ApplyReason;
     parameters[16].Value = model.ApplyRemark;
     return(SqlHelper.ExecuteNonQuery(sqltran, CommandType.StoredProcedure, P_STOPCUSTAPPLY_UPDATE, parameters));
 }
Exemplo n.º 7
0
        private void GetInfoByTaskID()
        {
            OrderCRMStopCustTaskInfo model_task = BLL.OrderCRMStopCustTask.Instance.GetOrderCRMStopCustTask(TaskID);

            if (model_task != null)
            {
                Entities.StopCustApply model_cust = BLL.StopCustApply.Instance.GetStopCustApply((int)model_task.RelationID);
                if (model_cust != null)
                {
                    DeleteMemberID     = model_cust.DeleteMemberID;
                    CustID             = model_cust.CustID;
                    CRMStopCustApplyID = model_cust.CRMStopCustApplyID.ToString();
                    stopStatus         = model_cust.StopStatus == (int)Entities.StopCustStopStatus.Pending ? true : false;
                }
            }
            string[] arrayBGID = new string[1];
            arrayBGID[0] = "2";
            //验证权限
            int typeLimit = AjaxServers.CommonFun.judgeLimit((int)model_task.AssignUserID, arrayBGID);

            switch (typeLimit)
            {
            case 3:
                operType = op;
                break;

            case 2:
                stopStatus = false;
                break;

            case 1: Response.Write(@"<script language='javascript'>alert('您没有该任务的访问权限,无法访问该页面。');try {
                                                           window.external.MethodScript('/browsercontrol/closepagereloadppage');
                                                       }
                                                       catch (e) {
                                                           window.opener = null; window.open('', '_self'); window.close();
                                                       }</script>");
                return;
            }
        }
Exemplo n.º 8
0
        //type=1:审批通过;type=2:驳回
        private void UpdateStopCustApply(int type, int RecID, string Reson, string taskID)
        {
            Entities.StopCustApply model    = BLL.StopCustApply.Instance.GetStopCustApply(RecID);
            Entities.StopCustApply oldModel = BLL.StopCustApply.Instance.GetStopCustApply(RecID);
            DateTime dtime = DateTime.Now;

            model.AuditTime = dtime;
            if (type == 1)
            {
                //审批通过,待停用或待启用
                model.StopStatus = (int)Entities.StopCustStopStatus.NoDisabled;
                //审核意见
                model.AuditOpinion = Reson;
            }
            else
            {
                //驳回
                model.StopStatus = (int)Entities.StopCustStopStatus.Reject;
                //驳回理由
                model.RejectReason = Reson;
            }
            BLL.StopCustApply.Instance.Update(model);
            Log.InsertLogStopCustApply(oldModel, model, BLL.Util.GetLoginUserID());
        }
Exemplo n.º 9
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(SqlTransaction sqltran, Entities.StopCustApply model)
 {
     return(Dal.StopCustApply.Instance.Update(sqltran, model));
 }
Exemplo n.º 10
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(Entities.StopCustApply model)
 {
     return(Dal.StopCustApply.Instance.Update(model));
 }
Exemplo n.º 11
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Insert(Entities.StopCustApply model)
 {
     return(Dal.StopCustApply.Instance.Insert(model));
 }
Exemplo n.º 12
0
        private Entities.StopCustApply LoadSingleStopCustApply(DataRow row)
        {
            Entities.StopCustApply model = new Entities.StopCustApply();

            if (row["RecID"].ToString() != "")
            {
                model.RecID = int.Parse(row["RecID"].ToString());
            }
            if (row["CRMStopCustApplyID"].ToString() != "")
            {
                model.CRMStopCustApplyID = int.Parse(row["CRMStopCustApplyID"].ToString());
            }
            model.CustID = row["CustID"].ToString();
            if (row["ApplyerID"].ToString() != "")
            {
                model.ApplyerID = int.Parse(row["ApplyerID"].ToString());
            }
            model.AreaName = row["AreaName"].ToString();
            if (row["AreaID"].ToString() != "")
            {
                model.AreaID = int.Parse(row["AreaID"].ToString());
            }
            if (row["ApplyTime"].ToString() != "")
            {
                model.ApplyTime = DateTime.Parse(row["ApplyTime"].ToString());
            }
            if (row["AuditTime"].ToString() != "")
            {
                model.AuditTime = DateTime.Parse(row["AuditTime"].ToString());
            }
            if (row["StopTime"].ToString() != "")
            {
                model.StopTime = DateTime.Parse(row["StopTime"].ToString());
            }
            if (row["StopStatus"].ToString() != "")
            {
                model.StopStatus = int.Parse(row["StopStatus"].ToString());
            }

            model.RejectReason   = row["RejectReason"].ToString();
            model.AuditOpinion   = row["AuditOpinion"].ToString();
            model.Remark         = row["Remark"].ToString();
            model.DeleteMemberID = row["DeleteMemberID"].ToString();

            if (row["ApplyType"].ToString() != "")
            {
                model.ApplyType = int.Parse(row["ApplyType"].ToString());
            }

            if (row["ApplyReason"].ToString() != "")
            {
                model.ApplyReason = int.Parse(row["ApplyReason"].ToString());
            }

            if (row["ApplyRemark"].ToString() != "")
            {
                model.ApplyRemark = int.Parse(row["ApplyRemark"].ToString());
            }


            return(model);
        }
        public int UpdateCRMCustStatusByIDAndRemark(string Verifycode, int CRMStopCustApplyID, int StopStatus, string Remark, int operID, ref string msg)
        {
            BLL.Loger.Log4Net.Info("调用了【CRM停用/启用核实更改状态】接口,传入参数为:" + string.Format("CRMStopCustApplyID:{0},StopStatus:{1},Remark:{2},operID:{3}", CRMStopCustApplyID, StopStatus, Remark, operID));
            int flag = 0;

            try
            {
                if (BLL.CallRecord_ORIG_Authorizer.Instance.Verify(Verifycode, 0, ref msg, "CRM申请停用调用,授权失败。"))
                {
                    flag = 1;
                    Entities.StopCustApply oldModel = BLL.StopCustApply.Instance.GetStopCustApplyByCrmStopCustApplyID(CRMStopCustApplyID);
                    Entities.StopCustApply model    = BLL.StopCustApply.Instance.GetStopCustApplyByCrmStopCustApplyID(CRMStopCustApplyID);
                    if (model != null)
                    {
                        DateTime dtime = DateTime.Now;
                        model.StopStatus = StopStatus;
                        model.StopTime   = dtime;
                        if (StopStatus == (int)StopCustStopStatus.Disabled)
                        {
                            model.Remark = Remark;
                        }
                        else if (StopStatus == (int)StopCustStopStatus.Reject)
                        {
                            model.RejectReason = Remark;
                        }
                        //更新主表
                        BLL.StopCustApply.Instance.Update(model);
                        //插入日志
                        Log.InsertLogStopCustApply(oldModel, model, operID);
                        //获取任务
                        OrderCRMStopCustTaskInfo model_task = BLL.OrderCRMStopCustTask.Instance.GetEntityByRelationID(model.RecID);
                        if (model_task != null)
                        {
                            BLL.Loger.Log4Net.Info("调用了【CRM停用/启用核实更改状态】接口当前任务状态=" + model_task.TaskStatus_Value + " 任务ID=" + model_task.TaskID_Value);
                            StopCustTaskOperStatus operstatus = StopCustTaskOperStatus.Disabled;
                            //停用申请,3是已停用
                            if (StopStatus == (int)StopCustStopStatus.Disabled && model.ApplyType == 1)
                            {
                                //操作状态是停用
                                operstatus = StopCustTaskOperStatus.Disabled;
                            }
                            //启用申请,3是已启用
                            else if (StopStatus == (int)StopCustStopStatus.Disabled && model.ApplyType == 2)
                            {
                                //操作状态是启用
                                operstatus = StopCustTaskOperStatus.Enable;
                            }
                            //剩余为驳回
                            else
                            {
                                operstatus = StopCustTaskOperStatus.Reject;
                            }
                            //记录操作日志
                            CRMStopCustWebService.InsertOperationLog(model_task.TaskID_Value, operID, Remark, (StopCustTaskStatus)model_task.TaskStatus_Value, operstatus);
                        }
                    }
                    return(flag);
                }
                else
                {
                    BLL.Loger.Log4Net.Info("调用了【CRM停用/启用核实更改状态】接口,验证失败。Verifycode:【" + Verifycode + "】,IP:【" + System.Web.HttpContext.Current.Request.UserHostAddress + "】");
                }
                return(flag);
            }
            catch (Exception ex)
            {
                BLL.Loger.Log4Net.Error("调用了【CRM停用/启用核实更改状态】接口出现异常:" + ex);
                return(flag);
            }
        }