Exemplo n.º 1
0
        [HttpGet]// /admin/department/tabledataks
        public void tabledataks()
        {
            try
            {
                Response.Clear();
                StringBuilder sb = new StringBuilder();
                sb.Append("companyID=" + adminLogin.companyID.ToString());

                string bmid = Request.QueryString["bmid"];
                if (!string.IsNullOrEmpty(bmid))
                {
                    if (Convert.ToInt32(bmid) != -1)
                    {
                        sb.Append(" and bmID=" + bmid);
                    }
                }
                Models.paging pag = new Models.paging()
                {
                    table    = "v_bmks",
                    order    = "createTime desc",
                    field    = "ksID[id],bm,ks,must,number,createTime,isExam,valid",
                    pageSize = Convert.ToInt32(Request.QueryString["limit"]),
                    pageNo   = Convert.ToInt32(Request.QueryString["page"]),
                    where    = sb.ToString()
                };
                Response.Write(BLL.pagingBLL.runLaypage(pag));
            }
            catch (Exception m)
            {
                Response.Write(m.Message);
            }
            finally { Response.End(); }
        }
Exemplo n.º 2
0
 public void tabledata()
 {
     try
     {
         Response.Clear();
         string wherestr = "companyID=" + adminLogin.companyID.ToString();
         string jbid     = Request.QueryString["jbid"];
         if (!string.IsNullOrEmpty(jbid))
         {
             if (Convert.ToInt32(jbid) != -1)
             {
                 wherestr += " and levelID=" + jbid;
             }
         }
         Models.paging pag = new Models.paging()
         {
             table    = "JobInfo a left join subjectLevel b on a.levelID=b.ID",
             order    = "createTime desc",
             field    = "a.id,b.name[jb],jobName[name],createTime,a.valid",
             pageSize = Convert.ToInt32(Request.QueryString["limit"]),
             pageNo   = Convert.ToInt32(Request.QueryString["page"]),
             where    = wherestr
         };
         Response.Write(BLL.pagingBLL.runLaypage(pag));
     }
     catch (Exception m)
     {
         Response.Write(m.Message);
     }
     finally { Response.End(); }
 }
Exemplo n.º 3
0
 public static string runpage(Models.paging pag, string format)
 {
     using (DAL.pagingDAL dal = new DAL.pagingDAL())
     {
         using (Common.JsonParse jp = new Common.JsonParse())
         {
             int       count = 0;
             DataTable dt    = dal.execPaging(pag, out count);
             return(jp.ToTablePage(dt, count, format));
         }
     }
 }
Exemplo n.º 4
0
 public void listdata()
 {
     try
     {
         Response.Clear();
         StringBuilder sb = new StringBuilder();
         sb.Append("[State]=1");
         string wherejson = Request.QueryString["wherejson"];
         if (!string.IsNullOrEmpty(wherejson))
         {
             Models.subFind m = JsonConvert.DeserializeObject <Models.subFind>(wherejson);
             if (m.sid != 0)
             {
                 sb.Append(" and SubjectClassID in (select id from f_getChildren(" + m.sid + "))");
             }
             if (m.title != "")
             {
                 sb.Append(" and Title like '%" + m.title.Trim() + "%'");
             }
             if (m.inputState != -1)
             {
                 sb.Append(" and inputState=" + m.inputState);
             }
             if (m.mindate != "")
             {
                 sb.Append(" and k.createTime>='" + m.mindate.Trim() + "'");
             }
             if (m.maxdate != "")
             {
                 sb.Append(" and k.createTime<='" + m.maxdate.Trim() + " 23:59:59'");
             }
         }
         Models.paging pag = new Models.paging()
         {
             table    = "LSSubject k join subjectClass s on k.SubjectClassID=s.ID",
             order    = "k.createTime desc",
             field    = "k.id,s.name[sname],title,result,k.createTime[date],inputState[state]",
             pageSize = Convert.ToInt32(Request.QueryString["limit"]),
             pageNo   = Convert.ToInt32(Request.QueryString["page"]),
             where    = sb.ToString()
         };
         Response.Write(BLL.pagingBLL.runLaypage(pag));
     }
     catch (Exception m)
     {
         Response.Write(m.Message);
     }
     finally { Response.End(); }
 }
Exemplo n.º 5
0
 /// <summary>
 /// 我的题库table
 /// </summary>/subject/tablelearnsubject
 public void tablelearnsubject()
 {
     try
     {
         Response.Clear();
         Models.paging pag = new Models.paging()
         {
             table    = "v_learnSubject",
             order    = "createTime desc",
             field    = "id,[sid],sname,[level],createTime,learns,counts,total,inlearn",
             pageSize = 50,
             pageNo   = 1,
             where    = "eid='" + employeeLogin.eid + "'"
         };
         Response.Write(BLL.pagingBLL.runLaypage(pag));
     }
     catch (Exception m)
     {
         Response.Write(m.Message);
     }
     finally { Response.End(); }
 }
Exemplo n.º 6
0
 /// <summary>
 /// 执行分页存储过程
 /// </summary>
 /// <param name="entity">分页实体</param>
 /// <param name="total">记录总数</param>
 /// <returns>DataTable</returns>
 public DataTable execPaging(Models.paging entity, out int total)
 {
     SqlParameter[] pars = {
                         new SqlParameter("@viewName",SqlDbType.VarChar,800),
                         new SqlParameter("@fieldName",SqlDbType.VarChar,800),
                         new SqlParameter("@orderString",SqlDbType.VarChar,200),
                         new SqlParameter("@whereString",SqlDbType.VarChar,800),
                         new SqlParameter("@pageSize",SqlDbType.Int),
                         new SqlParameter("@pageNo",SqlDbType.Int),
                         new SqlParameter("@recordTotal",SqlDbType.Int)
                         };
     pars[0].Value = entity.table;
     pars[1].Value = entity.field;
     pars[2].Value = entity.order;
     pars[3].Value = entity.where;
     pars[4].Value = entity.pageSize;
     pars[5].Value = entity.pageNo;
     pars[6].Direction = ParameterDirection.Output;
     DataTable dt = SqlHelper.RunProcedure("[sp_paging]", pars);
     total = Convert.ToInt32(pars[6].Value);
     return dt;
 }
Exemplo n.º 7
0
 public void getdata()
 {
     try
     {
         Response.Clear();
         Models.paging pag = new Models.paging()
         {
             table    = "replacegif",
             order    = "id desc",
             field    = "*",
             pageSize = Convert.ToInt32(Request.QueryString["limit"]),
             pageNo   = Convert.ToInt32(Request.QueryString["page"]),
             where    = "1=1"
         };
         Response.Write(BLL.pagingBLL.runLaypage(pag));
     }
     catch (Exception m)
     {
         Response.Write(m.Message);
     }
     finally { Response.End(); }
 }
Exemplo n.º 8
0
 /// <summary>
 /// 获得评论
 /// </summary>/subject/commentdata
 public void commentdata()
 {
     try
     {
         Response.Clear();
         string        sb  = "valid=1 and [sid]=" + Request.QueryString["sid"].ToString();
         Models.paging pag = new Models.paging()
         {
             table    = "v_comment",
             order    = "createTime desc",
             field    = "photo,ename,content,evaluate,createTime,reply",
             pageSize = 10,
             pageNo   = Convert.ToInt32(Request.QueryString["page"]),
             where    = sb
         };
         Response.Write(BLL.pagingBLL.runpage(pag, "yyyy-MM-dd HH:mm:ss"));
     }
     catch (Exception m)
     {
         Response.Write(m.Message);
     }
     finally { Response.End(); }
 }
Exemplo n.º 9
0
 // 获得意见反馈
 public void tabledata()
 {
     try
     {
         Response.Clear();
         string        sb  = "display=1";
         Models.paging pag = new Models.paging()
         {
             table    = "v_feedback",
             order    = "replyTime desc,[date] desc",
             field    = "photo,name,[date],content,isdispose,reply",
             pageSize = 10,
             pageNo   = Convert.ToInt32(Request.QueryString["page"]),
             where    = sb
         };
         Response.Write(BLL.pagingBLL.runpage(pag, "yyyy-MM-dd HH:mm:ss"));
     }
     catch (Exception m)
     {
         Response.Write(m.Message);
     }
     finally { Response.End(); }
 }
Exemplo n.º 10
0
        [HttpGet]// /admin/department/tabledatabm
        public void tabledatabm()
        {
            try
            {
                Response.Clear();
                string wherestr = "[type]=1 and companyID=" + adminLogin.companyID.ToString();

                Models.paging pag = new Models.paging()
                {
                    table    = "(select * from department where [type]=1) a left join(select bmID,COUNT(*)[kss] from v_bmks group by bmID) b on a.ID=b.bmID",
                    order    = "createTime desc",
                    field    = "id,name,isnull(kss,0)[kss],createTime,valid",
                    pageSize = Convert.ToInt32(Request.QueryString["limit"]),
                    pageNo   = Convert.ToInt32(Request.QueryString["page"]),
                    where    = wherestr
                };
                Response.Write(BLL.pagingBLL.runLaypage(pag));
            }
            catch (Exception m)
            {
                Response.Write(m.Message);
            }
            finally { Response.End(); }
        }
Exemplo n.º 11
0
 public void tabledata()
 {
     try
     {
         Response.Clear();
         StringBuilder sb = new StringBuilder();
         sb.Append("valid=1 and companyID=" + adminLogin.companyID.ToString());
         string wherejson = Request.QueryString["wherejson"];
         if (!string.IsNullOrEmpty(wherejson))
         {
             employeeListFindwhere m = JsonConvert.DeserializeObject <employeeListFindwhere>(wherejson);
             if (m.ename != "")
             {
                 sb.Append(" and name like '%" + m.ename.Trim() + "%'");
             }
             if (m.sex != -1)
             {
                 sb.Append(" and sexID=" + m.sex);
             }
             if (m.idcard != "")
             {
                 sb.Append(" and idcard like '%" + m.idcard.Trim() + "%'");
             }
             if (m.bm != -1)
             {
                 sb.Append(" and departmentID=" + m.bm);
             }
             if (m.ks != -1)
             {
                 sb.Append(" and officesID=" + m.ks);
             }
             if (m.jb != -1)
             {
                 sb.Append(" and levelID=" + m.jb);
             }
             if (m.zc != -1)
             {
                 sb.Append(" and jobInfoID=" + m.zc);
             }
             if (m.minreg != "")
             {
                 sb.Append(" and registerTime>='" + m.minreg.Trim() + "'");
             }
             if (m.maxreg != "")
             {
                 sb.Append(" and registerTime<='" + m.maxreg.Trim() + " 23:59:59'");
             }
             if (m.state != -1)
             {
                 sb.Append(" and state=" + m.state);
             }
         }
         Models.paging pag = new Models.paging()
         {
             table    = "v_employeeList",
             order    = "applyTime desc,registerTime desc",
             field    = "id,name,sex,idcard,phone,registerTime,department,offices,[level],jobInfo,[state]",
             pageSize = Convert.ToInt32(Request.QueryString["limit"]),
             pageNo   = Convert.ToInt32(Request.QueryString["page"]),
             where    = sb.ToString()
         };
         Response.Write(BLL.pagingBLL.runLaypage(pag, null));
     }
     catch (Exception m)
     {
         Response.Write(m.Message);
     }
     finally { Response.End(); }
 }