Exemplo n.º 1
0
 public void BindData()
 {
     try
     {
         page = 0;
         List <Common.Entities.LibraryRecord> list = new List <Common.Entities.LibraryRecord>();
         if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
         {
             list = BLLLibraryRecord.FindAll("合同");
         }
         else
         {
             int UserInfoID = BLLUser.FindID(Session["LoginName"].ToString());
             list = BLLLibraryRecord.FindByBorrowPeopel(UserInfoID, "合同");
         }
         var res = list.Skip(Grid_LibraryRecord_Pact.PageIndex * Grid_LibraryRecord_Pact.PageSize).Take(Grid_LibraryRecord_Pact.PageSize).ToList();
         Grid_LibraryRecord_Pact.RecordCount = list.Count();
         Grid_LibraryRecord_Pact.DataSource  = res;
         Grid_LibraryRecord_Pact.DataBind();
         btnDelete.Enabled = false;
     }
     catch (Exception ex)
     {
         publicMethod.SaveError(ex, this.Request);
     }
 }
Exemplo n.º 2
0
 public void check()
 {
     try
     {
         if (DropDownListPact.SelectedText == "全部")
         {
             BindData();
             return;
         }
         else
         {
             page = 1;
             Grid_LibraryRecord_Pact.PageIndex = 0;
             string PactNum = DropDownListPact.SelectedText;
             //int PactID = BLLPact.FindByPactNum(ContractHeadline).PactID;
             //根据资料编号和用户名(非管理员)查询借阅信息
             //string UserName = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
             int UserID = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserInfoID;
             List <Common.Entities.LibraryRecord> list = new List <Common.Entities.LibraryRecord>();
             if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
             {
                 //根据资料编号和用户名(非管理员)查询借阅信息
                 //string UserName = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                 list = BLLLibraryRecord.FindRecordByPactNum(PactNum, UserID);
             }
             //管理员查询
             else
             {
                 list = BLLLibraryRecord.FindByPactNum(DropDownListPact.SelectedText);
             }
             if (list != null)
             {
                 var res = list.Skip(Grid_LibraryRecord_Pact.PageIndex * Grid_LibraryRecord_Pact.PageSize).Take(Grid_LibraryRecord_Pact.PageSize).ToList();
                 Grid_LibraryRecord_Pact.RecordCount = list.Count();
                 Grid_LibraryRecord_Pact.DataSource  = res;
                 Grid_LibraryRecord_Pact.DataBind();
                 btnDelete.Enabled = false;
             }
             else
             {
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         publicMethod.SaveError(ex, this.Request);
     }
 }