コード例 #1
0
ファイル: ILog.cs プロジェクト: hofmannzhu/bwjs
        /// <summary>
        /// 操作日志
        /// </summary>
        /// <param name="logContent">日志内容</param>
        /// <param name="companyId">渠道编号</param>
        /// <param name="businessType">业务类型1网贷2保险3信用卡</param>
        /// <param name="relationId">关联编号</param>
        /// <returns>操作日志添加结果</returns>
        static public int OperationLogAdd(int relationId, string logContent, int companyId = 1, int businessType = 1)
        {
            int result = -1;

            try
            {
                int    userId         = -1;
                string realName       = string.Empty;
                int    departmentId   = -1;
                string departmentName = string.Empty;

                LoginUserCookie currentUser = MerchantFrontCookieBLL.GetMerchantFrontUserCookie();
                if (currentUser != null)
                {
                    UsersBLL op    = new UsersBLL();
                    Users    model = new Users();
                    model        = op.GetModel(currentUser.LoginUserID);
                    userId       = currentUser.LoginUserID;
                    departmentId = model.DepartmentID;
                    if (model != null)
                    {
                        realName = model.UserName;

                        DepartmentInfoBLL opDepartment        = new DepartmentInfoBLL();
                        DepartmentInfo    modelDepartmentInfo = new DepartmentInfo();
                        modelDepartmentInfo = opDepartment.GetModel(departmentId);
                        if (modelDepartmentInfo != null)
                        {
                            departmentName = modelDepartmentInfo.DepartmentName;
                        }
                    }
                }

                StackTrace st        = new StackTrace(true);
                MethodBase mb        = st.GetFrame(1).GetMethod();
                string     clsString = mb.DeclaringType.FullName;
                string     mName     = mb.Name;

                OperationLogBLL opOperationLog    = new OperationLogBLL();
                OperationLog    modelOperationLog = new OperationLog();

                modelOperationLog.BusinessType   = businessType;
                modelOperationLog.RelationId     = relationId;
                modelOperationLog.LogContent     = logContent;
                modelOperationLog.Ip             = System.Web.HttpContext.Current.Request.UserHostAddress;
                modelOperationLog.UserId         = userId;
                modelOperationLog.RealName       = realName;
                modelOperationLog.CreateDate     = DateTime.Now;
                modelOperationLog.DepartmentId   = departmentId;
                modelOperationLog.DepartmentName = departmentName;
                modelOperationLog.CreateDate     = DateTime.Now;
                result = opOperationLog.Add(modelOperationLog);
            }
            catch (Exception ex)
            {
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);
        }
コード例 #2
0
ファイル: UserManager.ashx.cs プロジェクト: hofmannzhu/bwjs
        public void GetUsersList(HttpContext context)
        {
            UsersBLL            usersbll = new UsersBLL();
            List <UsersBackups> list     = new List <UsersBackups>();
            string LoginName             = context.Request.QueryString["LoginName"];
            string UsersName             = context.Request.QueryString["UsersName"];
            string Mobiles = context.Request.QueryString["Mobiles"];

            string            Where = " u.RecordIsDelete=0 ";
            DepartmentInfo    df    = new DepartmentInfo();
            DepartmentInfoBLL bll   = new DepartmentInfoBLL();

            df = bll.GetModel(ComPage.CurrentAdmin.DepartmentID);
            if (ComPage.CurrentAdmin.UserType != 1)
            {
                if ((df == null) || (df != null && df.IsReceiveBusiness != false))
                {
                    Where += " AND  u.UserID IN(select ID from [dbo].[GetDepartmentChildren](" + ComPage.CurrentAdmin.UserID + "))";
                }
            }
            if (!string.IsNullOrEmpty(LoginName))
            {
                Where += " AND LoginName like'%" + LoginName + "%' ";
            }
            if (!string.IsNullOrEmpty(Mobiles))
            {
                Where += " AND phone like'%" + Mobiles + "%' ";
            }
            if (!string.IsNullOrEmpty(UsersName))
            {
                Where += " AND UserName like'%" + UsersName + "%' ";
            }
            //if (!string.IsNullOrEmpty(UsersData) && UsersData != "")
            //{
            //    Where += " AND (LoginName like'" + UsersData + "%' or phone like'" + UsersData + "%' or UserName like '" + UsersData + "%') ";
            //}
            list = usersbll.GetModelListName(Where);
            var b = SerializerHelper.SerializeObject(new { data = list });

            context.Response.Write(b);
        }
コード例 #3
0
        /// <summary>
        /// 获取用户列表
        /// </summary>
        static public Object GetUsersList()
        {
            string result = string.Empty;

            try
            {
                string sEcho         = JsonRequest.GetJsonKeyVal(jsonText, "sEcho");
                int    displayStart  = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayStart"));
                int    displayLength = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayLength"));
                int    pageIndex     = (displayStart / displayLength) + 1;
                int    pageSize      = displayLength;

                #region 获取列表
                StringBuilder where = new StringBuilder();
                where.Append("1=1 and u.RecordIsDelete=0 ");
                DepartmentInfo    df  = new DepartmentInfo();
                DepartmentInfoBLL bll = new DepartmentInfoBLL();
                df = bll.GetModel(ComPage.CurrentAdmin.DepartmentID);

                if (ComPage.CurrentAdmin.UserType != 1)
                {
                    if ((df == null) || (df != null && df.IsReceiveBusiness != false))
                    {
                        where.Append(" AND  u. UserID IN(select ID from [BWJSDB].dbo.[GetDepartmentChildren](" + ComPage.CurrentAdmin.UserID + "))");
                    }
                }

                #region 条件搜索
                string key = DNTRequest.GetString("searchKey");
                if (string.IsNullOrEmpty(key))
                {
                    key = JsonRequest.GetJsonKeyVal(jsonText, "searchKey");
                }
                string LoginName        = DNTRequest.GetString("LoginName");
                string UsersName        = DNTRequest.GetString("UsersName");
                string Mobiles          = DNTRequest.GetString("Mobiles");
                string DepartmentInfoID = DNTRequest.GetString("DepartmentInfoID");

                if (string.IsNullOrEmpty(LoginName))
                {
                    LoginName = JsonRequest.GetJsonKeyVal(jsonText, "LoginName");
                    LoginName = System.Web.HttpContext.Current.Server.UrlDecode(LoginName);
                }
                if (string.IsNullOrEmpty(UsersName))
                {
                    UsersName = JsonRequest.GetJsonKeyVal(jsonText, "UsersName");
                    UsersName = System.Web.HttpContext.Current.Server.UrlDecode(UsersName);
                }
                if (string.IsNullOrEmpty(Mobiles))
                {
                    Mobiles = JsonRequest.GetJsonKeyVal(jsonText, "Mobiles");
                    Mobiles = System.Web.HttpContext.Current.Server.UrlDecode(Mobiles);
                }
                if (string.IsNullOrEmpty(DepartmentInfoID))
                {
                    DepartmentInfoID = JsonRequest.GetJsonKeyVal(jsonText, "DepartmentInfoID");
                    DepartmentInfoID = System.Web.HttpContext.Current.Server.UrlDecode(DepartmentInfoID);
                }



                if (!string.IsNullOrEmpty(LoginName))
                {
                    where.AppendFormat(" and u.LoginName like'{0}%'  ", LoginName);
                }
                if (!string.IsNullOrEmpty(UsersName))
                {
                    where.AppendFormat(" and u.UserName like'{0}%'  ", UsersName);
                }
                if (!string.IsNullOrEmpty(Mobiles))
                {
                    where.AppendFormat(" and u.Phone like'{0}%'  ", Mobiles);
                }
                if (!string.IsNullOrEmpty(DepartmentInfoID) && DepartmentInfoID != "undefined" && DepartmentInfoID != "0")
                {
                    where.AppendFormat(" and u.DepartmentID ={0}  ", DepartmentInfoID);
                }
                #endregion

                string iSortCol_0   = JsonRequest.GetJsonKeyVal(jsonText, "iSortCol_0");
                string sSortDir_0   = JsonRequest.GetJsonKeyVal(jsonText, "sSortDir_0");
                int    iSortingCols = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iSortingCols"));
                string orderBy      = string.Empty;
                if (!string.IsNullOrEmpty(iSortCol_0))
                {
                    string orderField = JsonRequest.GetJsonKeyVal(jsonText, string.Format("mDataProp_{0}", iSortCol_0));
                    orderBy = string.Format(" {0} {1}", orderField, sSortDir_0);
                }

                string    sql      = "";
                int       zys      = 0;
                int       sumcount = 0;
                UsersBLL  Usersbll = new UsersBLL();
                DataTable dt       = Usersbll.GetList(where.ToString(), pageIndex, pageSize, orderBy, ref sql, ref zys, ref sumcount);

                /*
                 *  iTotalRecord = sumcount,
                 *  iTotalDisplayRecords = sumcount,
                 */
                object obj = new
                {
                    result          = true,
                    code            = "",
                    msg             = "",
                    recordsTotal    = sumcount,
                    recordsFiltered = sumcount,
                    data            = ((dt == null) ? (new DataTable()) : (dt)),
                    sEcho           = sEcho,
                };
                result = Newtonsoft.Json.JsonConvert.SerializeObject(obj);

                #endregion
            }
            catch (Exception ex)
            {
                result = DNTRequest.GetResultJson(false, "操作异常,请稍候再试", null);
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);
        }
コード例 #4
0
        /// <summary>
        /// 获取分利列表
        /// </summary>
        static public Object GetOrderRebateList()
        {
            string result = string.Empty;

            try
            {
                string sEcho         = JsonRequest.GetJsonKeyVal(jsonText, "sEcho");
                int    displayStart  = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayStart"));
                int    displayLength = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayLength"));
                int    pageIndex     = (displayStart / displayLength) + 1;
                int    pageSize      = displayLength;

                #region 获取列表
                StringBuilder where = new StringBuilder();
                where.Append("1=1 and ort.IsDeleted=0 ");
                DepartmentInfo    df  = new DepartmentInfo();
                DepartmentInfoBLL bll = new DepartmentInfoBLL();
                df = bll.GetModel(ComPage.CurrentAdmin.DepartmentID);
                if (ComPage.CurrentAdmin.UserType != 1)
                {
                    if ((df == null) || (df != null && df.IsReceiveBusiness != false))
                    {
                        //where.Append(" AND  moa.UserID IN(select ID from [BWJSDB].dbo.[GetDepartmentChildren](" + ComPage.CurrentAdmin.UserID + "))");
                        where.Append(" AND moa.UserID IN(SELECT ID from[BWJSDB].dbo.[GetDepartmentChildren](" + ComPage.CurrentAdmin.UserID + "))");
                    }
                }

                #region 条件搜索
                string key = DNTRequest.GetString("searchKey");
                if (string.IsNullOrEmpty(key))
                {
                    key = JsonRequest.GetJsonKeyVal(jsonText, "searchKey");
                }

                string val = DNTRequest.GetString("searchValue");
                if (string.IsNullOrEmpty(val))
                {
                    val = JsonRequest.GetJsonKeyVal(jsonText, "searchValue");
                    val = System.Web.HttpContext.Current.Server.UrlDecode(val);
                }

                if (!string.IsNullOrEmpty(val))
                {
                    where.AppendFormat(" and  (moa.InsureNum like'" + val + "%'  or ort.TransNo  like'" + val + "%') ", val);
                }
                #endregion

                string iSortCol_0   = JsonRequest.GetJsonKeyVal(jsonText, "iSortCol_0");
                string sSortDir_0   = JsonRequest.GetJsonKeyVal(jsonText, "sSortDir_0");
                int    iSortingCols = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iSortingCols"));
                string orderBy      = string.Empty;
                if (!string.IsNullOrEmpty(iSortCol_0))
                {
                    string orderField = JsonRequest.GetJsonKeyVal(jsonText, string.Format("mDataProp_{0}", iSortCol_0));
                    orderBy = string.Format(" {0} {1}", orderField, sSortDir_0);
                }

                string         sql            = "";
                int            zys            = 0;
                int            sumcount       = 0;
                OrderRebateBLL orderRebatebll = new OrderRebateBLL();
                DataTable      dt             = orderRebatebll.GetList(where.ToString(), pageIndex, pageSize, orderBy, ref sql, ref zys, ref sumcount);

                /*
                 *  iTotalRecord = sumcount,
                 *  iTotalDisplayRecords = sumcount,
                 */
                object obj = new
                {
                    result          = true,
                    code            = "",
                    msg             = "",
                    recordsTotal    = sumcount,
                    recordsFiltered = sumcount,
                    data            = ((dt == null) ? (new DataTable()) : (dt)),
                    sEcho           = sEcho,
                };
                result = Newtonsoft.Json.JsonConvert.SerializeObject(obj);

                #endregion
            }
            catch (Exception ex)
            {
                result = DNTRequest.GetResultJson(false, "操作异常,请稍候再试", null);
                ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString());
            }
            return(result);
        }