Ejemplo n.º 1
0
        public static string CategoryIdToName(string strWhere)
        {
            CategoryDto dto = new CategoryDto();
            DataTable   dt  = CMSService.SelectOne("Category", "CMSCategory", strWhere);

            foreach (DataRow dr in dt.Rows)
            {
                dto = CategoryMapping.getDTO(dr);
            }
            return(dto.CategoryName);
        }
Ejemplo n.º 2
0
        public static string UserIdToName(string strWhere)
        {
            UserDto   dto = new UserDto();
            DataTable dt  = CMSService.SelectOne("User", "CMSUser", strWhere);

            foreach (DataRow dr in dt.Rows)
            {
                dto = UserMapping.getDTO(dr);
            }
            return(dto.UserName);
        }
Ejemplo n.º 3
0
        public static double GetFenshuByCategory(int categoryId)
        {
            double      fenshu = 0;
            CategoryDto dto    = new CategoryDto();
            DataTable   dt     = CMSService.SelectOne("Category", "CMSCategory", "CategoryId=" + categoryId);

            foreach (DataRow dr in dt.Rows)
            {
                dto = CategoryMapping.getDTO(dr);
            }
            try
            {
                fenshu = double.Parse(dto.CategoryDescription);
            }
            catch
            {
                fenshu = 0;
            }
            return(fenshu);
        }
Ejemplo n.º 4
0
        //多个用户角色,从ID转化成名字
        public static string RolesIdToRolesName(string RoesId)
        {
            string userRoles = "";
            string roleName  = "";
            string s         = RoesId;

            string[] sArray = s.Split(',');
            foreach (string i in sArray)
            {
                DataTable dt = CMSService.SelectOne("Role", "CMSRole", "RoleId=" + int.Parse(i));
                foreach (DataRow dataRow in dt.Rows)
                {
                    RoleDto roleDto = new RoleDto();
                    roleDto  = RoleMapping.getDTO(dataRow);
                    roleName = roleDto.RoleName;
                }
                userRoles = userRoles + roleName + ",";
            }
            userRoles = userRoles.Substring(0, userRoles.Length - 1);
            return(userRoles);
        }