public List <LookupModel> AdvanceSearch(LookUp lookUp, string searchText)
        {
            try
            {
                List <LookupModel> list = new List <LookupModel>();
                switch (lookUp)
                {
                case LookUp.Department:
                    Department departmentEntity = new Department();
                    return(list = departmentEntity.AdvanceSearch(searchText));

                case LookUp.RoleCategory:
                    RoleCategory roleCategoryEntity = new RoleCategory();
                    return(list = roleCategoryEntity.AdvanceSearch(searchText));

                case LookUp.Status:
                    Status statusEntity = new Status();
                    return(list = statusEntity.AdvanceSearch(searchText));

                case LookUp.OPDRate:
                    OPDRate OPDRateEntity = new OPDRate();
                    return(list = OPDRateEntity.AdvanceSearch(searchText));

                case LookUp.RoomType:
                    RoomType RoomTypeEntity = new RoomType();
                    return(list = RoomTypeEntity.AdvanceSearch(searchText));

                case LookUp.Ward:
                    WardDetail WardDetailEntity = new WardDetail();
                    return(list = WardDetailEntity.AdvanceSearch(searchText));

                default:
                    return(list);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public List <LookupModel> Get(LookUp lookUp)
        {
            try
            {
                List <LookupModel> list = new List <LookupModel>();
                switch (lookUp)
                {
                case LookUp.Department:
                    Department departmentEntity = new Department();
                    return(list = departmentEntity.Get());

                case LookUp.RoleCategory:
                    RoleCategory roleCategoryEntity = new RoleCategory();
                    return(list = roleCategoryEntity.Get());

                case LookUp.Status:
                    Status statusEntity = new Status();
                    return(list = statusEntity.Get());

                case LookUp.OPDRate:
                    OPDRate OPDRateEntity = new OPDRate();
                    return(list = OPDRateEntity.Get());

                case LookUp.RoomType:
                    RoomType roomTypeEntity = new RoomType();
                    return(list = roomTypeEntity.Get());

                case LookUp.Ward:
                    WardDetail wardEntity = new WardDetail();
                    return(list = wardEntity.Get());

                default:
                    return(list);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public LookupModel GetByName(LookUp lookUp, string name)
        {
            try
            {
                LookupModel model = new LookupModel();
                switch (lookUp)
                {
                case LookUp.Department:
                    Department departmentEntity = new Department();
                    return(model = departmentEntity.GetByName(name));

                case LookUp.RoleCategory:
                    RoleCategory roleCategoryEntity = new RoleCategory();
                    return(model = roleCategoryEntity.GetByName(name));

                case LookUp.Status:
                    Status statusEntity = new Status();
                    return(model = statusEntity.GetByName(name));

                case LookUp.OPDRate:
                    return(model = OPDRate.GetRatesByType(name));

                case LookUp.RoomType:
                    RoomType roomTypeEntity = new RoomType();
                    return(model = roomTypeEntity.GetByName(name));

                case LookUp.Ward:
                    WardDetail wardEntity = new WardDetail();
                    return(model = wardEntity.GetByName(name));

                default:
                    return(model);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 4
0
        public static IList <RoleCategory> GetList()
        {
            DatabaseProviderFactory factory = new DatabaseProviderFactory();
            var list = new List <RoleCategory>();
            var db   = factory.Create(Constant.Database_Beautiful);
            var dr   = db.ExecuteReader(System.Data.CommandType.StoredProcedure, "[dbo].[get_category_list]");

            while (dr.Read())
            {
                var rci = new RoleCategory();
                rci.ParentID = Converter.ToInt32(dr["parent_id"]);
                rci.Name     = dr["name"].ToString();
                //目前放在json节点之前、才能生成
                rci.ID        = Converter.ToInt32(dr["id"]);
                rci.NodeStyle = Converter.ToString(dr["node_style"]);
                rci.EdgeStyle = Converter.ToString(dr["edge_style"]);
                rci.TreeStyle = string.Empty;
                rci.Shape     = dr["shape"].ToString();

                list.Add(rci);
            }
            return(list);
        }
Esempio n. 5
0
 /// <summary>
 /// 根据角色类型、角色分类获取 RoleDomain List: Add By Shakken Xie on 2010 - 3 - 11
 /// </summary>
 /// <param name="roleType">RoleType enum</param>
 /// <param name="roleCategory">RoleCategoru enum</param>
 /// <returns></returns>
 public virtual List<BusinessRoleDomain> GetBusinessRoleDomainListByRoleTypeAndRoleCategory(RoleType roleType, RoleCategory roleCategory)
 {
     string roleTypeId = SystemService.ParameterService.GetParameterId(roleType);
     List<BusinessRoleDomain> resultList = new List<BusinessRoleDomain>();
     List<SecRoleEntity> list = SelectByCondition<SecRoleEntity>(BPSC.Common.Utils.QueryCondition.Create().Equals(SecRoleTable.C_ROLE_TYPE, roleTypeId).Equals(SecRoleTable.C_ROLE_CATEGORY, roleCategory.GetHashCode()).Order(SecRoleTable.C_ROLE_NAME));
     foreach (SecRoleEntity item in list)
     {
         resultList.Add(new BusinessRoleDomain(item));
     }
     return resultList;
 }