//保存 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); } }
public void BindData() { //int ContractID = Convert.ToInt32(Request.QueryString["id"].ToString()); int LibraryRecordID = Convert.ToInt32(Session["LibraryRecordID"]); if (LibraryRecordID != 0) { libraryRecord = BLLLibraryRecord.FindByLibreryRecordID(LibraryRecordID); txtContractName.Text = BLLContract.FindByContractID(libraryRecord.ContractID).ContractHeadLine; txtBorrowPeople.Text = BLLUser.FindUserName(libraryRecord.UserInfoID); DatePicker_BorrowTime.SelectedDate = libraryRecord.BorrowTime; DatePicker_ReturnTime.SelectedDate = libraryRecord.ReturnTime; } }