Exemplo n.º 1
0
 //根据鉴定评语级别查询
 public void FindByLevel()
 {
     try
     {
         ViewState["page"] = 6;
         List <Common.Entities.Achievement> list = achieve.FindByLevel(tCondition.Text.Trim(), Convert.ToInt32(Session["SecrecyLevel"]));
         Grid_Achievementt.RecordCount = list.Count();
         if (list != null)
         {
             Grid_Achievementt.DataSource = list.Skip(Grid_Achievementt.PageIndex * Grid_Achievementt.PageSize).Take(Grid_Achievementt.PageSize);
             Grid_Achievementt.DataBind();
         }
         else
         {
             return;
         }
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
     }
 }
Exemplo n.º 2
0
 //导出
 protected void btn_Get_Click(object sender, EventArgs e)
 {
     try
     {
         if (page == 0)
         {
             List <Common.Entities.Achievement> list = achieve.FindPaged(Convert.ToInt32(Session["SecrecyLevel"]));
             if (list != null)
             {
                 Grid_Achievementt.DataSource = list;
                 Grid_Achievementt.DataBind();
             }
         }
         if (page == 1)
         {
             // List<int> ProjectID = project.FindProjectList(tCondition.Text.Trim(), Convert.ToInt32(Session["SecrecyLevel"]));
             List <Common.Entities.Achievement> list = achieve.FindByProject(tCondition.Text.Trim(), Convert.ToInt32(Session["SecrecyLevel"]));
             if (list != null)
             {
                 Grid_Achievementt.DataSource = list;
                 Grid_Achievementt.DataBind();
             }
         }
         if (page == 2)
         {
             List <int> UserInfoID = user.FindList(tCondition.Text.Trim(), Convert.ToInt32(Session["SecrecyLevel"]));
             List <int> AchieveID  = blst.SelectIDlist(UserInfoID, Convert.ToInt32(Session["SecrecyLevel"]));
             List <Common.Entities.Achievement> list = achieve.SelectAll(AchieveID, Convert.ToInt32(Session["SecrecyLevel"]));
             if (list != null)
             {
                 Grid_Achievementt.DataSource = list;
                 Grid_Achievementt.DataBind();
             }
         }
         if (page == 3)
         {
             List <Common.Entities.Achievement> list = achieve.FindByName(tCondition.Text.Trim(), Convert.ToInt32(Session["SecrecyLevel"]));
             if (list != null)
             {
                 Grid_Achievementt.DataSource = list;
                 Grid_Achievementt.DataBind();
             }
         }
         if (page == 4)
         {
             List <Common.Entities.Achievement> list = achieve.FindByTime(Convert.ToInt32(dCondition.SelectedText.Trim()), Convert.ToInt32(Session["SecrecyLevel"]));
             if (list != null)
             {
                 Grid_Achievementt.DataSource = list;
                 Grid_Achievementt.DataBind();
             }
         }
         if (page == 5)
         {
             List <Common.Entities.Achievement> list = achieve.FindByUnit(tCondition.Text.Trim(), Convert.ToInt32(Session["SecrecyLevel"]));
             if (list != null)
             {
                 Grid_Achievementt.DataSource = list;
                 Grid_Achievementt.DataBind();
             }
         }
         if (page == 6)
         {
             List <Common.Entities.Achievement> list = achieve.FindByLevel(tCondition.Text.Trim(), Convert.ToInt32(Session["SecrecyLevel"]));
             if (list != null)
             {
                 Grid_Achievementt.DataSource = list;
                 Grid_Achievementt.DataBind();
             }
         }
         if (page == 9)
         {
             int selevel = LevelChange(dCondition.SelectedText.Trim());
             List <Common.Entities.Achievement> list = achieve.FindBySecrecyLevel(selevel, Convert.ToInt32(Session["SecrecyLevel"]));
             if (list != null)
             {
                 Grid_Achievementt.DataSource = list;
                 Grid_Achievementt.DataBind();
             }
         }
         if (page == 10)
         {
             List <Common.Entities.Achievement> list = achieve.FindByMember(tCondition.Text.Trim(), Convert.ToInt32(Session["SecrecyLevel"]));
             if (list != null)
             {
                 Grid_Achievementt.DataSource = list;
                 Grid_Achievementt.DataBind();
             }
         }
         pm.ExportExcel(3, Grid_Achievementt, 2);
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
     }
 }