コード例 #1
0
ファイル: SysUser.aspx.cs プロジェクト: a157591984/jiguang
 protected void Page_Load(object sender, EventArgs e)
 {
     Module_Id = "90100300";
     SetSearchP();
     ReturnUrl = strPageName + "?" + Rc.Cloud.Web.Common.pfunction.getPageParam();
     //得到用户在此页面的权限
     //UserFun = MS.Authority.clsAuth.GetUserFunc(sysLoginUser.sysUser_ID, PHHC.Share.StrUtility.clsUtility.ReDoStr(sysLoginUser.SysRole_IDs, ','), Module_Id);
     UserFun = new Rc.Cloud.BLL.BLL_clsAuth().GetUserFunc(loginUser.SysUser_ID, clsUtility.ReDoStr(loginUser.SysRole_IDs, ','), Module_Id);
     if (!IsPostBack)
     {
         SetSearchO();
     }
 }
コード例 #2
0
        public static string GetTwo_WayChecklist(string DocName, string strGradeTerm, string strSubject, string strResource_Version, string AuditState, int PageIndex, int PageSize)
        {
            try
            {
                DocName   = DocName.Filter();
                PageIndex = Convert.ToInt32(PageIndex.ToString().Filter());
                Model_VSysUserRole loginUser = (Model_VSysUserRole)HttpContext.Current.Session["LoginUser"];
                Rc.Cloud.Model.Model_Struct_Func UserFun;
                UserFun = new Rc.Cloud.BLL.BLL_clsAuth().GetUserFunc(loginUser.SysUser_ID, (loginUser == null ? "''" : clsUtility.ReDoStr(loginUser.SysRole_IDs, ',')), "30100200");
                #region 资源信息
                DataTable     dtTwo       = new DataTable();
                List <object> listReturn  = new List <object>();
                string        strSql      = string.Empty;
                string        strSqlCount = string.Empty;
                string        strWhere    = string.Empty;
                if (!string.IsNullOrEmpty(DocName))
                {
                    strWhere += " and Two_WayChecklist_Name like '%" + DocName.Filter() + "%' ";
                }
                if (strGradeTerm != "-1")
                {
                    strWhere += " and GradeTerm = '" + strGradeTerm.Filter() + "' ";
                }
                if (strSubject != "-1")
                {
                    strWhere += " and Subject = '" + strSubject.Filter() + "' ";
                }
                if (strResource_Version != "-1")
                {
                    strWhere += " and Resource_Version = '" + strResource_Version.Filter() + "' ";
                }
                if (AuditState != "-1")
                {
                    if (AuditState == "3")
                    {
                        strWhere += " and Status is null ";
                    }
                    else
                    {
                        strWhere += " and Status='" + AuditState + "' ";
                    }
                }
                strWhere   += " and A.Two_WayChecklist_Id in(select Two_WayChecklist_Id  from Two_WayChecklistToTestpaper)";
                strSqlCount = @"select count(1) from Two_WayChecklist A  
left JOIN  Two_WayChecklistAudit t on t.Two_WayChecklist_Id=A.Two_WayChecklist_Id  where 1=1 " + strWhere + " ";
                strSql      = @"select * from (select ROW_NUMBER() over(ORDER BY t.Status,t.CreateTime DESC) row,A.*,t.Status,t.CreateTime AuditTime,UserName=isnull(su.SysUser_Name,su.SysUser_LoginName)  
,t1.D_Name as GradeTermName,t2.D_Name as SubjectName,t3.D_Name as Resource_VersionName
from Two_WayChecklist A  
left JOIN  Two_WayChecklistAudit t on t.Two_WayChecklist_Id=A.Two_WayChecklist_Id
left join  SysUser su on su.SysUser_ID=t.CreateUser
left join Common_Dict t1 on t1.Common_Dict_Id=A.GradeTerm
left join Common_Dict t2 on t2.Common_Dict_Id=A.Subject
left join Common_Dict t3 on t3.Common_Dict_Id=A.Resource_Version
where 1=1 " + strWhere + " ) z where row between " + ((PageIndex - 1) * PageSize + 1) + " and " + (PageIndex * PageSize) + "  ";
                dtTwo       = Rc.Common.DBUtility.DbHelperSQL.Query(strSql).Tables[0];
                int rCount = Convert.ToInt32(Rc.Common.DBUtility.DbHelperSQL.GetSingle(strSqlCount).ToString());
                int inum   = 0;
                for (int i = 0; i < dtTwo.Rows.Count; i++)
                {
                    inum++;
                    string docName = dtTwo.Rows[i]["Two_WayChecklist_Name"].ToString();
                    //docName = pfunction.GetDocFileName(docName);
                    string strOperate = string.Empty;
                    listReturn.Add(new
                    {
                        inum             = (i + 1),
                        docId            = dtTwo.Rows[i]["Two_WayChecklist_Id"].ToString(),
                        GradeTerm        = dtTwo.Rows[i]["GradeTermName"].ToString(),
                        Subject          = dtTwo.Rows[i]["SubjectName"].ToString(),
                        Resource_Version = dtTwo.Rows[i]["Resource_VersionName"].ToString(),
                        docName          = docName,
                        docNameSub       = pfunction.GetSubstring(docName, 30, true),
                        AuditTime        = pfunction.ConvertToLongDateTime(dtTwo.Rows[i]["AuditTime"].ToString()),
                        AuditStateStr    = dtTwo.Rows[i]["Status"].ToString() == "" ? "<span style='color:red'>未审核</span>" : dtTwo.Rows[i]["Status"].ToString() == "1" ? "<span style='color:green'>已审核</span>" : "<span style='color:blue'>审核未通过</span>",
                        UserName         = dtTwo.Rows[i]["UserName"].ToString(),
                        Status           = dtTwo.Rows[i]["Status"].ToString(),
                        Operate          = strOperate
                    });
                }
                #endregion

                if (inum > 0)
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "null",
                        PageIndex = PageIndex,
                        PageSize = PageSize,
                        TotalCount = rCount,
                        list = listReturn
                    }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "暂无数据"
                    }));
                }
            }
            catch (Exception)
            {
                return(JsonConvert.SerializeObject(new
                {
                    err = "error"//ex.Message.ToString()
                }));
            }
        }
コード例 #3
0
        public static string GetCloudBooks(string DocName, string strResource_Type, string strResource_Class, string strGradeTerm, string strSubject, string strResource_Version, string AuditState, string ATime, int PageIndex, int PageSize)
        {
            try
            {
                DocName   = DocName.Filter();
                ATime     = ATime.Filter();
                PageIndex = Convert.ToInt32(PageIndex.ToString().Filter());
                Model_VSysUserRole loginUser = (Model_VSysUserRole)HttpContext.Current.Session["LoginUser"];
                Rc.Cloud.Model.Model_Struct_Func UserFun;
                UserFun = new Rc.Cloud.BLL.BLL_clsAuth().GetUserFunc(loginUser.SysUser_ID, (loginUser == null ? "''" : clsUtility.ReDoStr(loginUser.SysRole_IDs, ',')), "10100500");
                #region 资源信息
                DataTable     dtRes       = new DataTable();
                List <object> listReturn  = new List <object>();
                string        strSql      = string.Empty;
                string        strSqlCount = string.Empty;

                string strWhere = string.Empty;
                if (!string.IsNullOrEmpty(DocName))
                {
                    strWhere += " and ResourceFolder_Name like '%" + DocName.Filter() + "%' ";
                }
                if (strResource_Class != "-1")
                {
                    strWhere += " and Resource_Class = '" + strResource_Class.Filter() + "' ";
                }
                if (strResource_Type != "-1")
                {
                    strWhere += " and Resource_Type = '" + strResource_Type.Filter() + "' ";
                }
                if (strGradeTerm != "-1")
                {
                    strWhere += " and GradeTerm = '" + strGradeTerm.Filter() + "' ";
                }
                if (strSubject != "-1")
                {
                    strWhere += " and Subject = '" + strSubject.Filter() + "' ";
                }
                if (strResource_Version != "-1")
                {
                    strWhere += " and Resource_Version = '" + strResource_Version.Filter() + "' ";
                }
                if (AuditState != "-1")
                {
                    if (AuditState == "3")
                    {
                        strWhere += " and AuditState is null ";
                    }
                    else
                    {
                        strWhere += " and AuditState='" + AuditState + "' ";
                    }
                }
                if (!string.IsNullOrEmpty(ATime))
                {
                    strWhere += " and convert(nvarchar(10),t.CreateTime,23)='" + ATime + "' ";
                }
                strWhere   += " AND ResourceFolder_Level=5";//管理员维护的书籍目录
                strSqlCount = @"select count(1) from ResourceFolder A  
left JOIN  BookAudit t on t.ResourceFolder_Id=A.ResourceFolder_Id  where 1=1 " + strWhere + " ";
                strSql      = @"select * from (select ROW_NUMBER() over(ORDER BY t.AuditState,t.CreateTime DESC) row,A.*,t.AuditState,t.CreateTime AuditTime,UserName=isnull(su.SysUser_Name,su.SysUser_LoginName)  
,t1.D_Name as GradeTermName,t2.D_Name as SubjectName,t3.D_Name as Resource_VersionName,t4.D_Name as Resource_TypeName
from ResourceFolder A  
left JOIN  BookAudit t on t.ResourceFolder_Id=A.ResourceFolder_Id
left join  SysUser su on su.SysUser_ID=t.CreateUser
left join Common_Dict t1 on t1.Common_Dict_Id=A.GradeTerm
left join Common_Dict t2 on t2.Common_Dict_Id=A.Subject
left join Common_Dict t3 on t3.Common_Dict_Id=A.Resource_Version
left join Common_Dict t4 on t4.Common_Dict_Id=A.Resource_Type
where 1=1 " + strWhere + " ) z where row between " + ((PageIndex - 1) * PageSize + 1) + " and " + (PageIndex * PageSize) + "  ";
                dtRes       = Rc.Common.DBUtility.DbHelperSQL.Query(strSql).Tables[0];
                int rCount = Convert.ToInt32(Rc.Common.DBUtility.DbHelperSQL.GetSingle(strSqlCount).ToString());
                int inum   = 0;
                for (int i = 0; i < dtRes.Rows.Count; i++)
                {
                    inum++;
                    string docName = dtRes.Rows[i]["ResourceFolder_Name"].ToString().ReplaceForFilter();
                    //docName = pfunction.GetDocFileName(docName);
                    string strOperate = string.Empty;
                    if (UserFun.Delete)
                    {
                        strOperate = string.Format("<a href=\"javascript:;\" onclick=\"DelData('{0}');\">删除</a>&nbsp;"
                                                   , dtRes.Rows[i]["ResourceFolder_Id"].ToString()
                                                   );
                    }
                    if (UserFun.Edit)
                    {
                        strOperate += string.Format("<a href=\"javascript:;\" onclick=\"EditData('{0}','0');\">编辑</a>"
                                                    , dtRes.Rows[i]["ResourceFolder_Id"].ToString()
                                                    );
                    }
                    listReturn.Add(new
                    {
                        inum             = (i + 1),
                        docId            = dtRes.Rows[i]["ResourceFolder_Id"].ToString(),
                        GradeTerm        = dtRes.Rows[i]["GradeTermName"].ToString(),
                        Subject          = dtRes.Rows[i]["SubjectName"].ToString(),
                        Resource_Version = dtRes.Rows[i]["Resource_VersionName"].ToString(),
                        Resource_Type    = dtRes.Rows[i]["Resource_TypeName"].ToString(),
                        docName          = docName,
                        docNameSub       = pfunction.GetSubstring(docName, 30, true),
                        AuditTime        = pfunction.ConvertToLongDateTime(dtRes.Rows[i]["AuditTime"].ToString()),
                        AuditStateStr    = dtRes.Rows[i]["AuditState"].ToString() == "" ? "<span style='color:red'>未审核</span>" : dtRes.Rows[i]["AuditState"].ToString() == "1" ? "<span style='color:green'>已审核</span>" : "<span style='color:blue'>审核未通过</span>",
                        UserName         = dtRes.Rows[i]["UserName"].ToString(),
                        AuditState       = dtRes.Rows[i]["AuditState"].ToString(),
                        Operate          = strOperate
                    });
                }
                #endregion

                if (inum > 0)
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "null",
                        PageIndex = PageIndex,
                        PageSize = PageSize,
                        TotalCount = rCount,
                        list = listReturn
                    }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "暂无数据"
                    }));
                }
            }
            catch (Exception)
            {
                return(JsonConvert.SerializeObject(new
                {
                    err = "error"//ex.Message.ToString()
                }));
            }
        }