コード例 #1
0
ファイル: TemplateService.cs プロジェクト: liuyouying/MVC
 public EasyUiGrid<Template> GetTemplate(Template filter,int pageSize,int pageIndex,ref int recordCount)
 {
     List<Template> Templates = _TemplateRepository.GetTemplate(filter,pageSize,pageIndex,ref recordCount);
     EasyUiGrid<Template> list = new EasyUiGrid<Template>();
     list.total = Templates.Count;
     list.rows = Templates;
     return list;
 }
コード例 #2
0
ファイル: LoginLogService.cs プロジェクト: liuyouying/MVC
 public EasyUiGrid<LoginLog> GetLoginLog(LoginLogFilter filter,int pageSize,int pageIndex,ref int recordCount)
 {
     List<LoginLog> loginlogs = _LoginLogRepository.GetLoginLog(filter,pageSize,pageIndex,ref recordCount);
     EasyUiGrid<LoginLog> list = new EasyUiGrid<LoginLog>();
     list.total = loginlogs.Count;
     list.rows = loginlogs;
     return list;
 }
コード例 #3
0
ファイル: ProjectService.cs プロジェクト: liuyouying/MVC
 public EasyUiGrid<Project> GetProjects(int roleId,int pageSize,int pageIndex,ref int recordCount)
 {
     List<Project> projects = _ProjectRepository.GetProjects(roleId,pageSize,pageIndex,ref recordCount);
     EasyUiGrid<Project> list = new EasyUiGrid<Project>();
     list.total = recordCount;
     list.rows = projects;
     return list;
 }
コード例 #4
0
ファイル: SampleService.cs プロジェクト: liuyouying/MVC
 public EasyUiGrid<Sample> GetSamples(SimpleFilter filter,int pageSize,int pageIndex,ref int recordCount)
 {
     List<Sample> samples = _SampleRepository.GetSamples(filter,pageSize,pageIndex,ref recordCount);
     EasyUiGrid<Sample> list = new EasyUiGrid<Sample>();
     list.total = samples.Count;
     list.rows = samples;
     return list;
 }
コード例 #5
0
ファイル: ProjectService.cs プロジェクト: liuyouying/MVC
 public EasyUiGrid<Project> GetProject(int pageSize,int pageIndex,ref int recordCount)
 {
     return CacheHelper.Get<EasyUiGrid<Project>>(BuildCacheKey("GetProject",pageIndex,pageSize),BuildCacheKey("GetProject_recordCount"),
         ref recordCount,CacheTimeOption.HalfDay,(ref int rc) =>
         {
             List<Project> projects = _ProjectRepository.GetProjects(pageSize,pageIndex,ref rc);
             EasyUiGrid<Project> list = new EasyUiGrid<Project>();
             list.total = rc;
             list.rows = projects;
             return list;
         });
 }
コード例 #6
0
 private void GetPaged()
 {
     int recordCount = 0;
     ProjectFilter filter = new ProjectFilter();
     string name = GetRequest("name");
     string adress = GetRequest("adress");
     if(!string.IsNullOrEmpty(name)){
         filter.ProjName = name;
     }
     if(!string.IsNullOrEmpty(adress)){
         filter.ProjAddress = adress;
     }
     List<Project> projects = _ProjectService.GetProjectList(filter,PageSize,PageIndex,ref recordCount);
     EasyUiGrid<Project> data = new EasyUiGrid<Project>();
     data.total = recordCount;
     data.rows = projects;
     Json(data);
 }
コード例 #7
0
        private void GetDic(int id,int parentId)
        {
            int recordCount = 0;
            StringBuilder sb = new StringBuilder();
            Dictionary dicFilter = new Dictionary();
            dicFilter.Id = id;
            dicFilter.ParentId = parentId;
            int temp = GetRequestString("temp").ToInt32(-1);
            if(temp == 0) //模板管理使用
            {
                parentId = 0;
                dicFilter.ParentId = ConfigHelper.GetSetting("SampleTypeId").ToInt32(1);
            }
            List<Dictionary> dictionarylist = _DictionaryService.GetDictionaryList(dicFilter,PageSize,PageIndex,ref recordCount);

            if((parentId == 0 && id == -1) || temp == 0){
                List<object> list = new List<object>();
                dictionarylist.ForEach(t =>
                {
                    if(GetRequestString("rm").ToInt32(-1) == 0 || temp == 0){
                        list.Add(new
                        {
                            id = t.Id,
                            text = t.Cname
                        });
                    }
                    else{
                        list.Add(new
                        {
                            id = t.Id,
                            text = new {text = t.Cname,t.Remarks}
                        });
                    }
                });
                Json(list);
            }
            else{
                EasyUiGrid<Dictionary> list = new EasyUiGrid<Dictionary>();
                list.total = dictionarylist.Count;
                list.rows = dictionarylist;
                Json(list);
            }
        }
コード例 #8
0
 private void GetProjects()
 {
     int recordCount = 0;
     ProjectFilter filter = new ProjectFilter();
     List<Project> list = _ProjectService.GetProjects(filter,UserContext.Instance.CurrentUser.Uid,int.MaxValue,1,ref recordCount);
     EasyUiGrid<Project> data = new EasyUiGrid<Project>();
     data.total = recordCount;
     data.rows = list;
     Json(data);
 }
コード例 #9
0
 private void GetProRight()
 {
     int roleId = GetRequest("roleId").ToInt32();
     ProjectFilter filter = new ProjectFilter();
     int recordCount = 0;
     List<Project> list = _ProjectService.GetProjects(filter,UserContext.Instance.CurrentUser.Uid,PageSize,PageIndex,ref recordCount);
     EasyUiGrid<Project> data = new EasyUiGrid<Project>();
     data.total = recordCount;
     data.rows = list;
     Json(data);
 }