示例#1
0
 //保存
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (BLLUser.FindByUserName(txtBorrowPeople.Text) == null)
         {
             Alert.ShowInTop("借阅人不存在,请重新输入!");
             return;
         }
         if (DatePicker_BorrowTime.SelectedDate > DatePicker_ReturnTime.SelectedDate)
         {
             Alert.ShowInTop("归还日期应该大于借阅日期!");
             return;
         }
         NewLibraryRecord = FindLibraryRecord();
         if (NewLibraryRecord != null)
         {
             BLLLibraryRecord.Insert(NewLibraryRecord);
             Alert.ShowInTop("保存成功!");
             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference());
         }
     }
     catch (Exception ex)
     {
         BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
         pm.SaveError(ex, this.Request);
     }
 }
示例#2
0
 //根据指导教师查询
 public void FindByTeacher()
 {
     try
     {
         if (TriggerBox.Text.Trim() == "")
         {
             Alert.ShowInTop("请输入搜索内容");
             return;
         }
         ViewState["page"] = 3;
         int            teanum      = bllUser.FindByUserName(TriggerBox.Text.Trim()).UserInfoID;
         List <Student> StudentList = bllStudent.FindByTeacher(teanum);
         GridProjectStudent.RecordCount = StudentList.Count();
         var result = StudentList.Skip(GridProjectStudent.PageIndex * GridProjectStudent.PageSize).Take(GridProjectStudent.PageSize).ToList();
         this.GridProjectStudent.DataSource = result;
         this.GridProjectStudent.DataBind();
         btnDelete.Enabled = false;
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }