//编辑选中行 protected void ButtonUpdate_Click(object sender, EventArgs e) { try { List <int> selections = publicmethod.GridCount(Grid_Platform, CBoxSelect); if (selections.Count() != 0) { if (selections.Count() == 1) { int rowID = Convert.ToInt32(Grid_Platform.DataKeys[selections[0]][0]); Session["PlatformID"] = rowID; Alert.Show("你确定要修改该行数据吗!", "确认消息", MessageBoxIcon.Information, Window_Update.GetShowReference("UpdatePlatform.aspx", "编辑平台信息"), Target.Top); } else { Alert.Show("一次仅可以对一行进行编辑!"); } } else { Alert.Show("请选择一行!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
protected void btn_DownLoadContract_Click(object sender, EventArgs e) { try { int unitLecturesID = Convert.ToInt32(Request.QueryString["id"].ToString()); unitLectures = BLLUL.FindByUnitLecturesID(unitLecturesID); if (unitLectures.AttachmentID != null && unitLectures.AttachmentID != 0) { int attachID = Convert.ToInt32(BLLUL.FindAttachmentid(unitLecturesID)); string path = BLLAttachment.FindPath(attachID); if (path != "") { publicMethod.DownloadFile(path); } else { Alert.ShowInTop("无附件可下载!"); } } else { Alert.ShowInTop("无附件可下载!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("附件下载失败,请与管理员联系!")); //Alert.ShowInTop("附件下载失败!"); } }
//搜索 protected void btnCheck_Click(object sender, EventArgs e) { try { Grid_Platform.PageIndex = 0; switch (ddlsearch.SelectedText) { case "全部": BindData(); break; case "平台名称": if (!string.IsNullOrEmpty(TriggerBox.Text.Trim())) { FindByPlatformName(); } else { Alert.ShowInTop("请填写查询条件!"); } break; case "平台级别": FindByPlatformType(); break; } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//下载 protected void DownLoad_Click(object sender, EventArgs e) { try { int AnnouncementID = Convert.ToInt32(Request.QueryString["id"].ToString()); Common.Entities.Announcement Announce = BLLAnnounce.Find(AnnouncementID); int attachId = BLLAnnounce.FindAttachmentID(AnnouncementID); if (attachId != 0) { string srcPath = BLLAttachment.FindPath(attachId); if (srcPath != "") { publicMethod.DownloadFile(srcPath); } else { Alert.ShowInTop("无附件可下载!"); } } else { Alert.ShowInTop("无附件可下载!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("附件下载失败,请与管理员联系!")); //Alert.ShowInTop("附件下载失败!"); } }
//初始化 public void InitData() { try { if (Session["PlatformID"].ToString() != "") { Common.Entities.Platform platform = new Common.Entities.Platform(); platform = BLLPlatform.FindByPlatformID(Convert.ToInt32(Session["PlatformID"])); txtPlatformName.Text = platform.PlatformName; DropDownListPlatformRank.SelectedValue = platform.PlatformRank; DropDownListAgreeUnit.SelectedValue = platform.AgreeUnit; DropDownListPlatformType.SelectedValue = platform.PlatformType; DatePicker_AgreeTime.SelectedDate = platform.AgreeTime; DropDownList_SecrecyLevel.SelectedValue = platform.SecrecyLevel.ToString(); //lby↓ txtAgreeNumber.Text = platform.AgreeNumber; txtAgreeExpenditure.Text = platform.AgreeExpenditure; txtPlatformPrincipal.Text = platform.PlatformPrincipal; txtPlatformMember.Text = platform.PlatformMember; txtPlatformManagement.Text = platform.PlatformManagement; } else { return; } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//下载 protected void DownLoad_Click(object sender, EventArgs e) { try { int AcademicID = Convert.ToInt32(Request.QueryString["id"].ToString()); int photoId = Blluser.FindPhotoID(AcademicID); if (photoId != 0) { string srcPaths = BLLAttachments.FindPath(photoId); if (srcPaths != "") { publicMethods.DownloadPhoto(srcPaths); } else { Alert.ShowInTop("无附件可下载!"); } } else { Alert.ShowInTop("无附件可下载!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("附件下载失败,请与管理员联系!")); } }
//保存 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 InitData() { try { if (Session["UnitLecturesID"].ToString() != "") { // OldUnitLectures = BLLUL.FindByUnitLecturesID(Convert.ToInt32(Session["UnitLecturesID"])); unitLectures = BLLUL.FindByUnitLecturesID(Convert.ToInt32(Session["UnitLecturesID"])); txtLecturesName.Text = unitLectures.LecturesName; DropDownList_Agency.Text = BLLAgency.FindAgenName(unitLectures.AgencyID); txtUReportName.Text = unitLectures.UReportName; DatePikerLecturesTime.Text = unitLectures.LecturesTime.Value.Year + "-" + unitLectures.LecturesTime.Value.Month + "-" + unitLectures.LecturesTime.Value.Day; txtWorkPlace.Text = unitLectures.WorkUnit; txtlistenerNumber.Text = unitLectures.listenerNumber.ToString(); DropDownList_SecrecyLevel.SelectedValue = unitLectures.SecrecyLevel.ToString(); txtLecturesPlace.Text = unitLectures.LecturesPlace; txtIDCard.Text = unitLectures.Identity; txtjobtitle.Text = unitLectures.WorkTitle; txtTel.Text = unitLectures.Telephone; Remark.Text = unitLectures.Remark; } else { return; } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//lby 会议照片界面跳转 protected string GetPhotoUrl(object AcademicMeetingID) { try { return(Window_DownLoad.GetShowReference("DownLoad_Photo.aspx?id=" + AcademicMeetingID, "操作")); } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); return(""); } }
//初始化 private void InitData() { try { tb_HorGProportion2.Text = blfundset.FindProportion("横向", "管理费").ToString(); tb_VerGProportion2.Text = blfundset.FindProportion("纵向", "管理费").ToString(); tb_school.Text = blfundset.FindProportion("校内", "管理费").ToString(); } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); return; } }
//结余经费 protected string getLostMoney(int id) { try { double FundCome = blfund.CountByOperate(id, "进账", Convert.ToInt32(Session["SecrecyLevel"])); double FundGive = blfund.CountByOperate(id, "支出", Convert.ToInt32(Session["SecrecyLevel"])); return((FundCome - FundGive).ToString()); } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); return(""); } }
public void BindData() { try { int ContractID = Convert.ToInt32(Request.QueryString["id"].ToString()); Contract = BLLContract.FindByContractID(Convert.ToInt32(ContractID)); ContractHeadLine.Text = Contract.ContractHeadLine; ContractAuthors.Text = Contract.ContractAuthors; ContractOriginal.Text = Contract.ContractOriginal; } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//编辑选中行 protected void btnUpdate_Click(object sender, EventArgs e) { try { int m; //取整数(不是四舍五入,全舍) int Pages = (int)Math.Floor(Convert.ToDouble(Grid_LibraryRecord_Pact.RecordCount / this.Grid_LibraryRecord_Pact.PageSize)); List <int> selections = new List <int>(); if (Grid_LibraryRecord_Pact.PageIndex == Pages) { m = (Grid_LibraryRecord_Pact.RecordCount - this.Grid_LibraryRecord_Pact.PageSize * Grid_LibraryRecord_Pact.PageIndex); } else { m = this.Grid_LibraryRecord_Pact.PageSize; } for (int i = 0; i < m; i++) { if (BoxSelect_PactRecord.GetCheckedState(i)) { selections.Add(i); } } if (selections.Count() != 0) { if (selections.Count() == 1) { int rowID = Convert.ToInt32(Grid_LibraryRecord_Pact.DataKeys[selections[0]][0]); Session["LibraryRecordID"] = rowID; Alert.Show("你确定要修改该行数据吗!", "确认消息", MessageBoxIcon.Information, Window_Update.GetShowReference("Update_PactRecord.aspx", "编辑借阅记录信息"), Target.Top); } else { Alert.Show("一次仅可以对一行进行编辑!"); } } else { Alert.Show("请选择一行!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//初始化会议分类下拉框 public void InitDropDownListSort() { try { List <BasicCode> list = bllBasicCode.FindALLName("会议分类名称"); for (int i = 0; i < list.Count(); i++) { DropDownList_MeetingSort.Items.Add(list[i].CategoryContent.ToString(), (i + 1).ToString()); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); return; } }
//初始化 public void InitData() { try { int AcademicID = Convert.ToInt32(Request.QueryString["id"].ToString()); Common.Entities.AcademicMeeting Academic = BLLAcademic.FindByAcademicMeetingID(AcademicID, true); MeetingName.Text = Academic.MeetingName; Organizers.Text = Academic.Organizers; Coorganizers.Text = Academic.Coorganizers; MeetingPlace.Text = Academic.MeetingPlace; } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//初始化 public void InitData() { try { int ReportID = Convert.ToInt32(Request.QueryString["id"].ToString()); Common.Entities.ScienceReport scienceReport = BLLScienceReprot.FindByReportID(ReportID); SReportName.Text = scienceReport.SReportName; SReportPeople.Text = scienceReport.SReportPeople; if (scienceReport.SReportTime != null) { DateTime date = scienceReport.SReportTime.Value; SReportTime.Text = date.Year + "-" + date.Month + "-" + date.Day; } SReportPlace.Text = scienceReport.SReportPlace; } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//搜索 protected void btnCheck_Click(object sender, EventArgs e) { //string strContractHeadLine = DropDownList_Contract.SelectedText; Grid_Contract.PageIndex = 0; try { if (tCondition.Text.Trim() != "") { FindByContractHeadLine(); } else { return; } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//对机构ID转化为机构名称(学术报告中显示的) public string AgencyName(int agency) { try { if (agency != null) { return(BLLAgency.FindAgenName(agency)); } //return agency.AgencyName.ToString(); else { return(" "); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); return(""); } }
//将人员ID转换为人名 public string FindBorrowPeople(int LibraryRecordID) { try { int? UserInfoID = BLLLibraryRecord.FindByLibreryRecordID(LibraryRecordID).UserInfoID; string strName = BLLUser.FindUserName(UserInfoID); if (strName != null) { return(strName); } else { return(" "); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); return(""); } }
//初始化 public void InitData() { try { if (Session["NewAcademicReportingID"].ToString() != "") { // Oldnewacademicreporting = BLLUL.FindBynewacademicreportingID(Convert.ToInt32(Session["newacademicreportingID"])); newacademicreporting = BLLNAR.FindByNAReportingID(Convert.ToInt32(Session["newacademicreportingID"])); DatePikerReportTime.Text = newacademicreporting.ReportTime.Value.Year + "-" + newacademicreporting.ReportTime.Value.Month + "-" + newacademicreporting.ReportTime.Value.Day; DropDownList_SecrecyLevel.SelectedValue = newacademicreporting.SecrecyLevel.ToString(); txtPeopleCount.Text = Convert.ToString(newacademicreporting.PeopleCount); txtRemark.Text = newacademicreporting.Remark; txtReportPeople.Text = newacademicreporting.ReportPeople; txtJobName.Text = newacademicreporting.JobName; txtJobMission.Text = newacademicreporting.JobMission; txtReportUnit.Text = newacademicreporting.ReportUnit; txtReport.Text = newacademicreporting.Report; txtReportTele.Text = newacademicreporting.ReportTele; txtAcademicTitle.Text = newacademicreporting.AcademicTitle; txtReportName.Text = newacademicreporting.ReportName; txtReportPlace.Text = newacademicreporting.ReportPlace; txtApplyFund.Text = newacademicreporting.ApplyFund; txtOrganizers.Text = newacademicreporting.Organizers; txtCoorganizer.Text = newacademicreporting.Coorganizer; txtReportType.Text = newacademicreporting.ReportType; txtMajorPeople.Text = newacademicreporting.MajorPeople; } else { return; } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//科研人员下拉框绑定 public void BindUser() { try { //根据用户的登陆级别 查询保密级别小于等于该用户级别的用户名称 对用户名称下拉框进行绑定 List <string> listUserName = BLLUser.FindUserBySecrecyLevel(Convert.ToInt32(Session["SecrecyLevel"])); if (listUserName != null) { for (int i = 0; i < listUserName.Count(); i++) { DropDownList_User.Items.Add(listUserName[i].ToString(), (i + 1).ToString()); } } } catch (Exception ex) { //抛出异常后写入错误日志中 BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); return; } }
//将PactID转换为资料名称 public string FindByPactIDAndSort(int LibraryRecordID, string Sort) { try { int? ContractID = BLLLibraryRecord.FindByLibreryRecordID(LibraryRecordID).ContractID; string strName = BLLLibraryRecord.FindByContractIDAndSort(ContractID, Sort); if (strName == null) { return(" "); } else { return(strName); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); return(""); } }
//搜索 protected void btnCheck_Click1(object sender, EventArgs e) { Grid_NAReporting.PageIndex = 0; try { if (txtReportName.Text.Trim() != "") { switch (ddl_search.SelectedIndex) { case 0: Alert.ShowInTop("请选择查询条件!"); return; case 1: FindBuRNHeadLine(); break; case 2: FindByReportTime(); break; case 3: FindByReportPeople(); break; } } else { Alert.ShowInTop("请输入查询条件!"); return; } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//初始化 public void InitData() { try { if (Session["ContractID"].ToString() != "") { Common.Entities.Contract contract = new Common.Entities.Contract(); contract = BLLcontract.FindByContractID(Convert.ToInt32(Session["ContractID"])); txtContractHeadLine.Text = contract.ContractHeadLine; txtContractAuthors.Text = contract.ContractAuthors; txtContractOriginal.Text = contract.ContractOriginal; } else { return; } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//编辑选中行 protected void btnUpdate_Click(object sender, EventArgs e) { try { List <int> selections = new List <int>(); for (int i = 0; i < Grid_NAReporting.RecordCount; i++) { if (CBoxSelect.GetCheckedState(i)) { selections.Add(i); } } if (selections.Count() != 0) { if (selections.Count() == 1) { int rowID = Convert.ToInt32(Grid_NAReporting.DataKeys[selections[0]][0]); Session["NewAcademicReportingID"] = rowID; Alert.Show("你确定要修改该行数据吗!", "确认消息", MessageBoxIcon.Information, Window_Update.GetShowReference("UpdateNAReporting.aspx", "编辑报告信息"), Target.Top); } else { Alert.Show("一次仅可以对一行进行编辑!"); } } else { Alert.Show("请选择一行!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//删除 protected void btnDeleteReport_Click(object sender, EventArgs e) { try { int m; //取整数(不是四舍五入,全舍) int Pages = (int)Math.Floor(Convert.ToDouble(Grid_ReportInfo.RecordCount / this.Grid_ReportInfo.PageSize)); if (Grid_ReportInfo.PageIndex == Pages) { m = (Grid_ReportInfo.RecordCount - this.Grid_ReportInfo.PageSize * Grid_ReportInfo.PageIndex); } else { m = this.Grid_ReportInfo.PageSize; } List <int> selections = new List <int>(); for (int i = 0; i < m; i++) { if (CBoxSelect_Report.GetCheckedState(i)) { selections.Add(i); } } if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { for (int i = 0; i < selections.Count(); i++) { int?attachid = BLLReport.Delete(Convert.ToInt32(Grid_ReportInfo.DataKeys[selections[i]][0].ToString())); if (attachid != 0 && attachid != null) {//删除附件 //在附件表中删除学术报告附件 BLLAttachment.Delete(Convert.ToInt32(attachid)); //删除附件文件 string path = BLLAttachment.FindPath(Convert.ToInt32(attachid)); if (path != "") { publicMethod.DeleteFile(Convert.ToInt32(attachid), path); } } } Grid_ReportInfo.PageIndex = 0; Grid_ReportInfo.PageSize = 20; btnDeleteReport.Enabled = false; DropDownList_Agency.SelectedValue = "0"; BindReport(); Alert.ShowInTop("删除成功!"); } else { for (int i = 0; i < selections.Count(); i++) { BLLReport.ChangePass(Convert.ToInt32(Grid_ReportInfo.DataKeys[selections[i]][0]), false); //向操作日志表插入信息 Common.Entities.OperationLog operationLog = new Common.Entities.OperationLog(); operationLog.LoginIP = " "; operationLog.LoginName = Session["LoginName"].ToString(); operationLog.OperationType = "删除"; operationLog.OperationContent = "ScienceReport"; operationLog.OperationTime = DateTime.Now; operationLog.OperationDataID = Convert.ToInt32(Grid_ReportInfo.DataKeys[selections[i]][0]); BLLOP.Insert(operationLog); } btnDeleteReport.Enabled = false; DropDownList_Agency.SelectedValue = "0"; Grid_ReportInfo.PageIndex = 0; Grid_ReportInfo.PageSize = 20; BindReport(); Alert.ShowInTop("您的数据已提交,请等待确认!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); return; } }
//保存机构信息 protected void Save_Click(object sender, EventArgs e) { try { if (AgencyName2.Text.Trim() == "") { Alert.ShowInTop("机构名称不能为空!"); AgencyName2.Text = ""; return; } if (AgencyHeads2.Text.Trim() == "") { Alert.ShowInTop("机构负责人不能为空!"); AgencyHeads2.Text = ""; return; } if (FullTimeNumber2.Text.Trim() == "") { Alert.ShowInTop("专职人数不能为空!"); FullTimeNumber2.Text = ""; return; } Common.Entities.Agency ag = new Common.Entities.Agency(); Common.Entities.OperationLog op = new Common.Entities.OperationLog(); BLHelper.BLLOperationLog blop = new BLHelper.BLLOperationLog(); BLHelper.BLLUser user = new BLHelper.BLLUser(); string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; ag.AgencyName = AgencyName2.Text.ToString(); ag.ParentID = agen.SelectAgencyID(ParentID2.Text.ToString()); ag.SecrecyLevel = Convert.ToInt32(DroSecrecyLevel.SelectedIndex + 1); ag.AgencyHeads = AgencyHeads2.Text.ToString(); ag.Research = Research2.Text.ToString(); ag.AgencyNumber = DroAgencyNumber.SelectedText; ag.FullTimeNumbers = Convert.ToInt32(FullTimeNumber2.Text.ToString()); ag.PartTimeNumbers = Convert.ToInt32(PartTimeNumber2.Text.ToString()); ag.Area = Area2.Text.ToString(); ag.IsGlobal = ddl_glo.SelectedText.Trim(); ag.Location = Location2.Text.ToString(); ag.EntryPerson = username; if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { ag.IsPass = true; agen.Insert(ag); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("保存成功") + Alert.GetShowInTopReference("保存成功")); } else { ag.IsPass = false; agen.Insert(ag); op.LoginIP = ""; op.LoginName = Session["LoginName"].ToString(); op.OperationContent = "Agency"; op.OperationDataID = agen.SelectAgencyID(AgencyName2.Text.Trim().ToString()); op.OperationType = "添加"; op.OperationTime = DateTime.Now; blop.Insert(op); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("您的操作已经提交,请等待管理员确认!")); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//保存 protected void btn_Save_Click(object sender, EventArgs e) { try { if (tb_MoneyNum.Text.Trim() == "") { Alert.ShowInTop("每项用途所用金额不能为空!"); tb_MoneyNum.Text = ""; return; } Common.Entities.Project project = pro.IsNullProject(tb_SourceWork.Text.Trim()); if (project == null) { tb_SourceWork.Text = ""; Alert.ShowInTop("无此项目,请检查输入!"); return; } else if (project.IsPass == false) { tb_SourceWork.Text = ""; Alert.ShowInTop("此项目正在审核中,请联系管理员!"); return; } double num = 0.0; if (!double.TryParse(tb_MoneyNum.Text.Trim(), out num)) { tb_MoneyNum.Reset(); Alert.ShowInTop("请输入数字!"); return; } if (dp_Time.SelectedDate == null) { Alert.ShowInTop("请选择日期!"); return; } Common.Entities.FundInformation fun = new Common.Entities.FundInformation(); Common.Entities.OperationLog op = new Common.Entities.OperationLog(); fun.BudgetDirector = tb_UserInfo.Text.Trim(); BLHelper.BLLUser user = new BLHelper.BLLUser(); string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; fun.EntryPerson = username; fun.EveItemUseMoney = tb_MoneyNum.Text.Trim(); fun.FundingPurposeSortName = ddl_FundingPurposeSortID.Text; fun.OperateType = "支出"; fun.ProjectID = project.ProjectID; fun.SecrecyLevel = Convert.ToInt32(DropDownListLevel.SelectedValue) + 1; fun.Time = dp_Time.SelectedDate; if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { fun.IsPass = true; fund.Insert(fun); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!")); } else { fun.IsPass = false; fund.Insert(fun); op.LoginIP = " "; op.LoginName = Session["LoginName"].ToString(); op.OperationContent = "FundInformation"; op.OperationDataID = fun.FundInformationID; op.OperationTime = DateTime.Now; op.OperationType = "添加"; blop.Insert(op); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("数据已经提交,请等待管理员确认!")); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//删除选中的单位讲学信息 protected void btnDelete_Click(object sender, EventArgs e) { try { List <int> selections = new List <int>(); for (int i = 0; i < Grid_NAReporting.RecordCount; i++) { if (CBoxSelect.GetCheckedState(i)) { selections.Add(i); } } if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { for (int i = 0; i < selections.Count(); i++) { int NAReportingID = Convert.ToInt32(Grid_NAReporting.DataKeys[selections[i]][0].ToString()); Common.Entities.NewAcademicReporting newacademicreporting = BLLNAR.FindByNAReportingID(NAReportingID); if (newacademicreporting.AttachmentID != null) { if (BllAttachment.SelectAttachmentName(Convert.ToInt32(newacademicreporting.AttachmentID)) != "") { //删除附件文件 string path = BllAttachment.FindPath(Convert.ToInt32(newacademicreporting.AttachmentID)); if (path != "") { publicMethod.DeleteFile(Convert.ToInt32(newacademicreporting.AttachmentID), path); //删除附件表中的数据 BllAttachment.Delete(Convert.ToInt32(newacademicreporting.AttachmentID));//删除成功返回true } } } //删除单位讲学信息 BLLNAR.Delete(NAReportingID);//删除成功返回true } Grid_NAReporting.PageIndex = 0; Grid_NAReporting.PageSize = 20; btnDelete.Enabled = false; BindData(); btnSelect_All.Text = "全选"; Alert.ShowInTop("删除数据成功!"); } else { for (int i = 0; i < selections.Count(); i++) { //BLLNAR.ChangePass(Convert.ToInt32(Grid_NAReporting.DataKeys[selections[i]][0]), false); operate.LoginName = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; operate.OperationTime = DateTime.Now; operate.LoginIP = " "; operate.OperationContent = "NewAcademicReporting"; operate.OperationType = "删除"; operate.OperationDataID = Convert.ToInt32(Grid_NAReporting.DataKeys[selections[i]][0]); BLLOP.Insert(operate); } Grid_NAReporting.PageIndex = 0; Grid_NAReporting.PageSize = 20; //DropDownList_Agency.SelectedValue = "0"; btnDelete.Enabled = false; BindData(); btnSelect_All.Text = "全选"; Alert.ShowInTop("操作已经提交,请等待管理员确认!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//删除借阅记录 protected void btnDelete_Click(object sender, EventArgs e) { try { int m; //取整数(不是四舍五入,全舍) int Pages = (int)Math.Floor(Convert.ToDouble(Grid_LibraryRecord_Pact.RecordCount / this.Grid_LibraryRecord_Pact.PageSize)); List <int> selections = new List <int>(); if (Grid_LibraryRecord_Pact.PageIndex == Pages) { m = (Grid_LibraryRecord_Pact.RecordCount - this.Grid_LibraryRecord_Pact.PageSize * Grid_LibraryRecord_Pact.PageIndex); } else { m = this.Grid_LibraryRecord_Pact.PageSize; } for (int i = 0; i < m; i++) { if (BoxSelect_PactRecord.GetCheckedState(i)) { selections.Add(i); } } if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { for (int i = 0; i < selections.Count(); i++) { BLLLibraryRecord.Delete(Convert.ToInt32(Grid_LibraryRecord_Pact.DataKeys[selections[i]][0].ToString())); } //刷新 btnDelete.Enabled = false; DropDownListPact.SelectedValue = "0"; Grid_LibraryRecord_Pact.PageIndex = 0; Grid_LibraryRecord_Pact.PageSize = 20; BindData(); Alert.ShowInTop("删除数据成功!"); } else { for (int i = 0; i < selections.Count(); i++) { BLLPact.UpdateIsPass(Convert.ToInt32(Grid_LibraryRecord_Pact.DataKeys[selections[i]][0]), false); operate.LoginName = Session["LoginName"].ToString(); operate.OperationTime = DateTime.Now; operate.LoginIP = " "; operate.OperationContent = "Pact"; operate.OperationType = "删除"; operate.OperationDataID = Convert.ToInt32(Grid_LibraryRecord_Pact.DataKeys[selections[i]][0]); op.Insert(operate); } //刷新 btnDelete.Enabled = false; DropDownListPact.SelectedValue = "0"; Grid_LibraryRecord_Pact.PageIndex = 0; Grid_LibraryRecord_Pact.PageSize = 20; BindData(); Alert.ShowInTop("操作已经提交,请等待管理员确认!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }