Beispiel #1
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="title"></param>
        /// <param name="summary"></param>
        /// <returns>JSON数据</returns>
        public string GetList(int page, int limit, string title = "", string summary = "", string orderByField = "ID", string orderByType = "ASC")
        {
            string where = "1=1";
            if (string.IsNullOrWhiteSpace(title) == false)
            {
                where += " AND TITLE LIKE '%" + title.Replace('\'', ' ') + "%'";
            }
            if (string.IsNullOrWhiteSpace(summary) == false)
            {
                where += " AND SUMMARY LIKE '%" + summary.Replace('\'', ' ') + "%'";
            }
            Library.BaseQuery.BBaseQuery.Order     order  = new Library.BaseQuery.BBaseQuery.Order(orderByField, orderByType);
            List <Models.FW.BulletinModelsForList> umList = new List <Models.FW.BulletinModelsForList>();
            IList <BLL.FW.BF_BULLETIN.Entity>      ueList = BLL.FW.BF_BULLETIN.Instance.GetListPage(limit, page, order, where);
            int count = BLL.FW.BF_BULLETIN.Instance.GetCount(where);

            if (ueList != null && ueList.Count > 0)
            {
                foreach (BLL.FW.BF_BULLETIN.Entity ue in ueList)
                {
                    Models.FW.BulletinModelsForList um = new Models.FW.BulletinModelsForList();
                    um.ID              = ue.ID;
                    um.TITLE           = ue.TITLE;
                    um.SUMMARY         = ue.SUMMARY;
                    um.IS_ENABLE       = ue.IS_ENABLE;
                    um.CONTENT         = ue.CONTENT;
                    um.CREATE_UID_NAME = BLL.FW.BF_USER.Instance.GetStringValueByKey(ue.CREATE_UID, "NAME");
                    um.CREATE_TIME     = ue.CREATE_TIME;
                    umList.Add(um);
                }
            }

            return(ToJsonString(umList, count));
        }
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="id"></param>
        /// <returns>JSON数据</returns>
        public string GetList(int page, int limit, string content = "", string daterange = "", string userName = "", string orderByField = "ID", string orderByType = "DESC")
        {
            #region 查询条件
            List <object> param = new List <object>();
            string where = "1=1";

            if (string.IsNullOrWhiteSpace(content) == false)
            {
                where += " and content LIKE '%" + content.Replace('\'', ' ') + "%'";
            }
            DateTime beginDate = DateTime.Today.AddDays(-1);
            DateTime endDate   = DateTime.Today;
            if (string.IsNullOrWhiteSpace(daterange) == false)
            {
                Functions.GetIntervalDate(daterange, ref beginDate, ref endDate);
            }
            where += " and LOG_TIME >= to_date('" + beginDate + "','yyyy-mm-dd hh24:mi:ss') and LOG_TIME < to_date('" + endDate.AddDays(1) + "','yyyy-mm-dd hh24:mi:ss')";
            if (string.IsNullOrWhiteSpace(userName) == false)
            {
                where += " and USER_NAME LIKE '%" + userName.Replace('\'', ' ') + "%'";
            }
            #endregion
            Library.BaseQuery.BBaseQuery.Order order = new Library.BaseQuery.BBaseQuery.Order(orderByField, orderByType);

            IList <BLL.FW.BF_OP_LOG.Entity> list = BLL.FW.BF_OP_LOG.Instance.GetListPage <BLL.FW.BF_OP_LOG.Entity>(limit, page, order, where, param);
            int count = BLL.FW.BF_OP_LOG.Instance.GetCount(where, param);
            if (list == null)
            {
                list  = new List <BLL.FW.BF_OP_LOG.Entity>();
                count = 0;
            }
            return(ToJsonString(list, count));
        }
Beispiel #3
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="pcode"></param>
        /// <param name="name"></param>
        /// <param name="code"></param>
        /// <returns>JSON数据</returns>
        public string GetList(int page, int limit, int pcode = 0, string name = "", string code = "", string orderByField = "ID", string orderByType = "ASC")
        {
            string where = "1=1";
            List <object> param = new List <object>();

            if (pcode > 0)
            {
                where += " AND P_CODE=?";
                param.Add(pcode);
            }
            if (string.IsNullOrWhiteSpace(name) == false)
            {
                where += " AND NAME LIKE '%" + name.Replace('\'', ' ') + "%'";
            }
            if (string.IsNullOrWhiteSpace(code) == false)
            {
                where += " AND DEPT_CODE=? ";
                param.Add(code);
            }
            Library.BaseQuery.BBaseQuery.Order order = new Library.BaseQuery.BBaseQuery.Order(orderByField, orderByType);

            IList <BF_DEPARTMENT.Entity> list = BF_DEPARTMENT.Instance.GetListPage <BF_DEPARTMENT.Entity>(limit, page, order, where, param);
            int count = BF_DEPARTMENT.Instance.GetCount(where, param);

            if (list == null)
            {
                list  = new List <BF_DEPARTMENT.Entity>();
                count = 0;
            }
            return(ToJsonString(list, count));
        }
Beispiel #4
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="name"></param>
        /// <param name="ip"></param>
        /// <param name="type"></param>
        /// <param name="orderByField"></param>
        /// <param name="orderByType"></param>
        /// <returns>JSON数据</returns>
        public string GetList(int page, int limit, string name = "", string ip = "", int type = 0, string orderByField = "ID", string orderByType = "ASC")
        {
            string where = "1=1";
            if (string.IsNullOrWhiteSpace(name) == false)
            {
                where += " AND NAME LIKE '%" + name.Replace('\'', ' ') + "%'";
            }
            if (string.IsNullOrWhiteSpace(ip) == false)
            {
                where += " AND IP LIKE '%" + ip.Replace('\'', ' ') + "%'";
            }
            if (type > 0)
            {
                where += " AND DB_TYPE=" + type;
            }
            Library.BaseQuery.BBaseQuery.Order order = new Library.BaseQuery.BBaseQuery.Order(orderByField, orderByType);
            IList <BF_DATABASE.Entity>         list  = BF_DATABASE.Instance.GetListPage <BF_DATABASE.Entity>(limit, page, order, where);
            int count = BF_DATABASE.Instance.GetCount(where);

            if (list == null)
            {
                list  = new List <BF_DATABASE.Entity>();
                count = 0;
            }
            return(ToJsonString(list, count));
        }
Beispiel #5
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="id"></param>
        /// <returns>JSON数据</returns>
        public string GetList(int page, int limit, string message = "", int TaskId = 0, string orderByField = "ID", string orderByType = "ASC")
        {
            if (TaskId <= 0)
            {
                return("[]");
            }

            List <object> param = new List <object>();

            string where = "TASK_ID=?";
            param.Add(TaskId);

            if (string.IsNullOrWhiteSpace(message) == false)
            {
                where += " and message LIKE '%" + message.Replace('\'', ' ') + "%'";
            }

            Library.BaseQuery.BBaseQuery.Order order = new Library.BaseQuery.BBaseQuery.Order(orderByField, orderByType);

            IList <BLL.FW.BF_ST_TASK_LOG.Entity> list = BLL.FW.BF_ST_TASK_LOG.Instance.GetListPage <BLL.FW.BF_ST_TASK_LOG.Entity>(limit, page, order, where, param);
            int count = BF_ST_TASK_LOG.Instance.GetCount(where, param);

            if (list == null)
            {
                list  = new List <BLL.FW.BF_ST_TASK_LOG.Entity>();
                count = 0;
            }
            return(ToJsonString(list, count));
        }
Beispiel #6
0
        /// <summary>
        /// 获取基础信息列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="name"></param>
        /// <returns>JSON数据</returns>
        public string GetList(int page, int limit, string name = "", string orderByField = "ID", string orderByType = "ASC")
        {
            string where = "1=1";
            List <object> param = new List <object>();

            if (string.IsNullOrWhiteSpace(name) == false)
            {
                where += " AND f.NAME LIKE '%" + name.Replace('\'', ' ') + "%'";
            }
            Library.BaseQuery.BBaseQuery.Order order = new Library.BaseQuery.BBaseQuery.Order(orderByField, orderByType);

            DataTable data = BLL.FW.BF_FORM.Instance.GetDataTable(limit, page, where, param);

            return(ToJsonString(data, data.Rows.Count));
        }
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="enName"></param>
        /// <param name="cnName"></param>
        /// <returns>JSON数据</returns>
        public string GetList(int page, int limit, string enName = "", string cnName = "", string orderByField = "ID", string orderByType = "ASC")
        {
            string where = "1=1";
            if (string.IsNullOrWhiteSpace(enName) == false)
            {
                where += " AND EN_NAME LIKE '%" + enName.Replace('\'', ' ') + "%'";
            }
            if (string.IsNullOrWhiteSpace(cnName) == false)
            {
                where += " AND CN_NAME LIKE '%" + cnName.Replace('\'', ' ') + "%'";
            }
            Library.BaseQuery.BBaseQuery.Order order = new Library.BaseQuery.BBaseQuery.Order(orderByField, orderByType);

            IList <BF_FIELD.Entity> list = BF_FIELD.Instance.GetListPage <BF_FIELD.Entity>(limit, page, order, where);
            int count = BF_FIELD.Instance.GetCount(where);

            if (list == null)
            {
                list  = new List <BF_FIELD.Entity>();
                count = 0;
            }
            return(ToJsonString(list, count));
        }
Beispiel #8
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="name"></param>
        /// <param name="cron"></param>
        /// <returns>JSON数据</returns>
        public string GetList(int page, int limit, string name = "", int runState = -1, int isEnable = -1, int lastTaskIs = -1, int self = 0, string orderByField = "ID", string orderByType = "ASC")
        {
            string where = "1=1";
            if (!string.IsNullOrWhiteSpace(name))
            {
                where += " AND NAME LIKE '%" + name.Replace('\'', ' ') + "%'";
            }
            if (runState > -1)
            {
                where += " AND RUN_STATUS = " + runState;
            }
            if (isEnable > -1)
            {
                where += " AND IS_ENABLE = " + isEnable;
            }
            if (lastTaskIs > -1)
            {
                where += " AND LAST_TASK_IS =" + lastTaskIs;
            }
            if (self > 0)
            {
                where += " AND CREATE_UID = " + SystemSession.UserID;
            }

            Library.BaseQuery.BBaseQuery.Order order = new Library.BaseQuery.BBaseQuery.Order(orderByField, orderByType);

            IList <BLL.FW.BF_ST_FLOW.Entity> list = BLL.FW.BF_ST_FLOW.Instance.GetListPage <BLL.FW.BF_ST_FLOW.Entity>(limit, page, order, where);
            int count = BLL.FW.BF_ST_FLOW.Instance.GetCount(where);

            if (list == null)
            {
                list  = new List <BLL.FW.BF_ST_FLOW.Entity>();
                count = 0;
            }
            return(ToJsonString(list, count));
        }
Beispiel #9
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="name"></param>
        /// <param name="fullName"></param>
        /// <returns>JSON数据</returns>
        public string GetList(int page, int limit, string deptCode = "", string name = "", string fullName = "", string orderByField = "ID", string orderByType = "ASC")
        {
            string where = "1=1";
            int dept = 0;

            int.TryParse(deptCode, out dept);
            if (dept > 0)
            {
                where += " AND DEPT_ID = " + dept;
            }
            if (string.IsNullOrWhiteSpace(name) == false)
            {
                where += " AND NAME LIKE '%" + name.Replace('\'', ' ') + "%'";
            }
            if (string.IsNullOrWhiteSpace(fullName) == false)
            {
                where += " AND FULL_NAME LIKE '%" + fullName.Replace('\'', ' ') + "%'";
            }

            Library.BaseQuery.BBaseQuery.Order order  = new Library.BaseQuery.BBaseQuery.Order(orderByField, orderByType);
            List <Models.FW.UserModelsForList> umList = new List <Models.FW.UserModelsForList>();
            IList <BLL.FW.BF_USER.Entity>      ueList = BLL.FW.BF_USER.Instance.GetListPage(limit, page, order, where);
            int count = BLL.FW.BF_USER.Instance.GetCount(where);

            if (ueList != null && ueList.Count > 0)
            {
                Dictionary <int, string> dicDeptName = BLL.FW.BF_DEPARTMENT.Instance.GetDictionary("ID", "NAME");
                Dictionary <int, string> dicRoleName = BLL.FW.BF_ROLE.Instance.GetDictionary("ID", "NAME");

                foreach (BLL.FW.BF_USER.Entity ue in ueList)
                {
                    Models.FW.UserModelsForList um = new Models.FW.UserModelsForList();
                    um.ID = ue.ID;
                    if (dicDeptName.ContainsKey(ue.DEPT_ID) == true)
                    {
                        um.DEPT_NAME = dicDeptName[ue.DEPT_ID];
                    }
                    um.E_MAIL          = ue.E_MAIL;
                    um.FULL_NAME       = ue.FULL_NAME;
                    um.IS_ENABLE       = ue.IS_ENABLE;
                    um.IS_LOCKED       = ue.IS_LOCKED;
                    um.LAST_LOGIN_TIME = ue.LAST_LOGIN_TIME;
                    um.LOGIN_COUNT     = ue.LOGIN_COUNT;
                    um.NAME            = ue.NAME;
                    um.PHONE_NUMBER    = ue.PHONE_NUMBER;
                    um.QQ = ue.QQ;

                    if (dicDeptName.Count > 0 && string.IsNullOrWhiteSpace(ue.ROLE_IDS) == false)
                    {
                        int roleID = 0;
                        foreach (string rid in ue.ROLE_IDS.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                        {
                            if (int.TryParse(rid, out roleID) && dicRoleName.ContainsKey(roleID) == true)
                            {
                                um.ROLE_NAMES += dicRoleName[roleID] + ",";
                            }
                        }
                    }
                    umList.Add(um);
                }
            }

            return(ToJsonString(umList, count));
        }