コード例 #1
0
        public static List <M_Users> GetUsers(string keyWords, string roleID, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            string whereSql = " Status<>9";

            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and ( Name like '%" + keyWords + "%' or MobilePhone like '%" + keyWords + "%' or Email like '%" + keyWords + "%')";
            }


            if (!string.IsNullOrEmpty(roleID))
            {
                whereSql += " and RoleID='" + roleID + "'";
            }

            DataTable      dt   = CommonBusiness.GetPagerData("M_Users", "*", whereSql, "AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <M_Users> list = new List <M_Users>();
            M_Users        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new M_Users();
                model.FillData(item);

                if (!string.IsNullOrEmpty(model.RoleID))
                {
                    model.Role = ManageSystemBusiness.GetRoleByIDCache(model.RoleID);
                }

                list.Add(model);
            }

            return(list);
        }
コード例 #2
0
        /// <summary>
        /// 获取日志
        /// </summary>
        /// <returns></returns>
        public static List <LogEntity> GetLogs(string guid, EnumLogObjectType type, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientid)
        {
            string tablename = "";

            switch (type)
            {
            case EnumLogObjectType.Customer:
                tablename = "CustomerLog";
                break;

            case EnumLogObjectType.Orders:
                tablename = "OrdersLog";
                break;

            case EnumLogObjectType.OrderTask:
                tablename = "OrderTaskLog";
                break;
            }

            DataTable dt = CommonBusiness.GetPagerData(tablename, "*", "LogGUID='" + guid + "'", "AutoID", pageSize, pageIndex, out totalCount, out pageCount);

            List <LogEntity> list = new List <LogEntity>();

            foreach (DataRow dr in dt.Rows)
            {
                LogEntity model = new LogEntity();
                model.FillData(dr);
                model.CreateUser = OrganizationBusiness.GetUserCacheByUserID(model.CreateUserID, clientid);

                list.Add(model);
            }
            return(list);
        }
コード例 #3
0
        public List <OtherSyncTaskRecord> GetSyncTaskRecord(int type, string status, string orderid, string clientid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            string sqlWhere = "a.Status<>9";

            if (!string.IsNullOrEmpty(orderid))
            {
                sqlWhere += " and ( a.OrderID ='" + orderid + "' )";
            }
            if (!string.IsNullOrEmpty(clientid))
            {
                sqlWhere += " and ( a.ClientID ='" + clientid + "' )";
            }
            if (type > 0)
            {
                sqlWhere += " and ( a.Type ='" + type + "' )";
            }
            if (!string.IsNullOrEmpty(status))
            {
                sqlWhere += " and ( a.Status in (" + status + ") )";
            }
            string    sqlColumn             = @" * ";
            DataTable dt                    = CommonBusiness.GetPagerData("OtherSyncTaskRecord a", sqlColumn, sqlWhere, "a.AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <OtherSyncTaskRecord> list = new List <OtherSyncTaskRecord>();

            foreach (DataRow dr in dt.Rows)
            {
                OtherSyncTaskRecord entity = new OtherSyncTaskRecord();
                entity.FillData(dr);
                entity.Content = string.IsNullOrEmpty(entity.Content) ? "" : entity.Content.Replace("“", "\"");
                list.Add(entity);
            }

            return(list);
        }
コード例 #4
0
        public List <ProvidersEntity> GetProviders(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientid)
        {
            var dal = new StockDAL();

            string where = " ClientID='" + clientid + "' and Status<>9";
            if (!string.IsNullOrEmpty(keyWords))
            {
                where += " and (Name like '%" + keyWords + "%' or Contact like '%" + keyWords + "%' or MobileTele like '%" + keyWords + "%')";
            }
            DataTable dt = CommonBusiness.GetPagerData("Providers", "*", where, "AutoID", pageSize, pageIndex, out totalCount, out pageCount);

            List <ProvidersEntity> list = new List <ProvidersEntity>();

            foreach (DataRow dr in dt.Rows)
            {
                ProvidersEntity model = new ProvidersEntity();
                model.FillData(dr);
                model.City = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
                list.Add(model);
            }
            return(list);
        }
コード例 #5
0
        public static List <Users> GetUsers(string keyWords, string departID, string roleID, string clientid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            string whereSql = "ClientID='" + clientid + "' and Status<>9";

            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and ( Name like '%" + keyWords + "%' or MobilePhone like '%" + keyWords + "%' or Email like '%" + keyWords + "%')";
            }

            if (!string.IsNullOrEmpty(departID))
            {
                whereSql += " and DepartID='" + departID + "'";
            }

            if (!string.IsNullOrEmpty(roleID))
            {
                whereSql += " and RoleID='" + roleID + "'";
            }

            DataTable    dt   = CommonBusiness.GetPagerData("Users", "*", whereSql, "AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <Users> list = new List <Users>();
            Users        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new Users();
                model.FillData(item);

                model.CreateUser = GetUserCacheByUserID(model.CreateUserID, model.ClientID);
                model.Department = GetDepartmentByID(model.DepartID, model.ClientID);
                model.Role       = GetRoleByIDCache(model.RoleID, model.ClientID);

                list.Add(model);
            }

            return(list);
        }