//GridEduExperience行命令 protected void GridEduExperience_RowCommand(object sender, FineUI.GridCommandEventArgs e) { try { string Person = GridEduExperience.Rows[e.RowIndex].Values[2].ToString(); string strs = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Person != strs && Convert.ToInt32(Session["SecrecyLevel"]) != 5) { string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!"; CBoxSelect.SetCheckedState(e.RowIndex, false); Alert.ShowInTop(str); } if (publicmethod.GridCount(GridEduExperience, CBoxSelect).Count == 0) { //Alert.ShowInTop("请选中需删除的数据!"); btnDelete.Enabled = false; return; } if (publicmethod.GridCount(GridEduExperience, CBoxSelect).Count != 0) { btnDelete.Enabled = true; return; } } catch (Exception ex) { publicmethod.SaveError(ex, this.Request); } }
//返回插入学术报告对象 public Common.Entities.ScienceReport InserScienceReport() { Common.Entities.ScienceReport scienceReport = new Common.Entities.ScienceReport(); scienceReport.AgencyID = BLLAgency.SelectAgencyID(DropDownList_AgencyName.SelectedText); scienceReport.EntryPerson = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;//必填 scienceReport.SReportTime = DatePicker_ReportTime.SelectedDate; //if (txtReportPlace.Text != "") // scienceReport.SReportPlace = txtReportPlace.Text; //else // scienceReport.SReportPlace = null; scienceReport.SReportPlace = txtReportPlace.Text; scienceReport.SReportPeople = txtReportPeople.Text; //必填 scienceReport.SReportName = txtReportName.Text; //必填 scienceReport.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedValue); //必填 scienceReport.MeetingID = BLLAM.FindMeetingID(DropDownListMeetingName.SelectedText); //必填 //如果AttachmentID为null则没有添加附件 //scienceReport.AccessoryID = AttachmentID; if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)//必填 { scienceReport.IsPass = true; } else { scienceReport.IsPass = false; } return(scienceReport); }
//添加按钮 protected void Save_Click(object sender, EventArgs e) { try { if (MissionName.Text.Trim() == "") { Alert.ShowInTop("节点名称不能为空!"); MissionName.Text = ""; return; } //一个项目里节点名称是可以重复的,不需要判断 Important.MissionName = MissionName.Text.Trim(); Important.ProjectID = bllProject.SelectProjectID(DropDownListProjectID.SelectedText); // Important.Time = DatePickerTime.SelectedDate; Important.StartTime = DatePickerStartTime.SelectedDate; Important.EndTime = DatePickerEndTime.SelectedDate; Important.CompleteSpecificPerson = CompleteSpecificPerson.Text.Trim(); //lby ↓ Important.ResearchCharge = Agency.SelectedText; Important.PersonCharge = txtPersonCharge.Text.Trim(); Important.ActualComleption = txtActualComleption.Text.Trim(); Important.ProjectCompletion = txtProjectCompletion.Text.Trim(); Important.Remark = Remark.Text.Trim(); Important.SecrecyLevel = DropDownListSecrecyLevel.SelectedIndex + 1; Important.EntryPerson = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Convert.ToInt32(Session["SecrecyLevel"]) != 5) { Important.IsPass = false; bllImportant.insert(Important); OperationLog operate = new OperationLog(); operate.LoginName = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName; operate.OperationType = "添加"; operate.OperationContent = "ProjectImportantNode"; operate.OperationDataID = bllImportant.FindImportantID(Important.MissionName.ToString(), Convert.ToDateTime(Important.StartTime.ToString()), Session["LoginName"].ToString()); operate.LoginIP = ""; operate.OperationTime = DateTime.Now; bllOperate.Insert(operate); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的操作已提交审核,请等待!")); } else { Important.IsPass = true; bllImportant.insert(Important); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("项目重大节点添加完成!")); } } catch (Exception ex) { publicmethod.SaveError(ex, this.Request); } }
//返回插入操作日志对象 public Common.Entities.OperationLog InsertOperationLog() { //向操作日志表插入信息 Common.Entities.OperationLog operationLog = new Common.Entities.OperationLog(); operationLog.LoginIP = " "; operationLog.LoginName = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; operationLog.OperationType = "更新"; operationLog.OperationContent = "UnitLectures"; operationLog.OperationTime = DateTime.Now; operationLog.OperationLogID = unitLectures.UnitLecturesID; operationLog.Remark = NewUnitLectures.UnitLecturesID.ToString(); return(operationLog); }
//返回插入操作日志对象 public Common.Entities.OperationLog InsertOperationLog() { //向操作日志表插入信息 Common.Entities.OperationLog operationLog = new Common.Entities.OperationLog(); operationLog.LoginIP = " "; operationLog.LoginName = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; operationLog.OperationType = "更新"; //operationLog.LoginName = Session["LoginName"].ToString(); operationLog.OperationContent = "NewAcademicReporting"; operationLog.OperationTime = DateTime.Now; operationLog.OperationLogID = newacademicreporting.NewAcademicReportingID; operationLog.Remark = Newnareporting.NewAcademicReportingID.ToString(); return(operationLog); }
//行点击事件 protected void Grid_Patent_RowCommand(object sender, FineUI.GridCommandEventArgs e) { try { string Person = Grid_Patent.Rows[e.RowIndex].Values[2].ToString(); string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Person != username && Convert.ToInt32(Session["SecrecyLevel"]) != 5) { string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!"; CBoxSelect.SetCheckedState(e.RowIndex, false); Alert.ShowInTop(str); return; } int m; //取整数(不是四舍五入,全舍) int Pages = (int)Math.Floor(Convert.ToDouble(Grid_Patent.RecordCount / this.Grid_Patent.PageSize)); if (Grid_Patent.PageIndex == Pages) { m = (Grid_Patent.RecordCount - this.Grid_Patent.PageSize * Grid_Patent.PageIndex); } else { m = this.Grid_Patent.PageSize; } bool isCheck = false; for (int i = 0; i < m; i++) { if (CBoxSelect.GetCheckedState(i)) { isCheck = true; } } if (isCheck) { Delete.Enabled = true; } else { Delete.Enabled = false; } } catch (Exception ex) { pm.SaveError(ex, this.Request); } }
//更新赋值 /* public void UpDateValue() * { * achieve.PactNum = txtPactNum.Text; * achieve.PactName = txtPactName.Text; * achieve.PactType = txtPactType.Text; * achieve.StartTime = DatePicker_StartTime.SelectedDate; * achieve.EndTime = DatePicker_EndTime.SelectedDate; * achieve.ProjectID = BLLProject.SelectProjectID(DropDownList_Project.SelectedText); * achieve.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedIndex + 1); * achieve.ChargePerson = txtChargePerson.Text; * achieve.PactMoney = txtPactMoney.Text; * achieve.RealMoney = txtRealMoney.Text; * achieve.PactCompletion = txtPactCompletion.Text; * achieve.IsExistingFile = txtIsExistingFile.Text; * achieve.FileNum = txtFileNum.Text; * //achieve.EntryPerson = BLLPact.FindByPactID(Convert.ToInt32(Session["PactID"])).EntryPerson; * * }*/ //原版本 /*public void BindData() * { * //int ContractID = Convert.ToInt32(Request.QueryString["id"].ToString()); * int LibraryRecordID = Convert.ToInt32(Session["LibraryRecordID"]); * if (LibraryRecordID != 0) * { * libraryRecord = BLLLibraryRecord.FindByLibreryRecordID(LibraryRecordID); * txtPactNum.Text = BLLPact.FindByPactID(Convert.ToInt32(libraryRecord.ContractID)).PactNum; * txtBorrowPeople.Text = BLLUser.FindUserName(libraryRecord.UserInfoID); * DatePicker_BorrowTime.SelectedDate = libraryRecord.BorrowTime; * DatePicker_ReturnTime.SelectedDate = libraryRecord.ReturnTime; * } * }*/ protected void btnSave_Click(object sender, EventArgs e) { try { achieve.PactNum = txtPactNum.Text; achieve.PactName = txtPactName.Text; achieve.PactType = txtPactType.Text; achieve.StartTime = DatePicker_StartTime.SelectedDate; achieve.EndTime = DatePicker_EndTime.SelectedDate; achieve.ProjectID = BLLProject.SelectProjectID(DropDownList_Project.SelectedText); achieve.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedIndex + 1); achieve.ChargePerson = txtChargePerson.Text; achieve.PactMoney = txtPactMoney.Text; achieve.RealMoney = txtRealMoney.Text; achieve.PactCompletion = txtPactCompletion.Text; achieve.IsExistingFile = txtIsExistingFile.Text; achieve.FileNum = txtFileNum.Text; string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; achieve.EntryPerson = username; achieve.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedIndex + 1); int AttachmentID = Convert.ToInt32(BLLPact.FindByPactID(Convert.ToInt32(Session["PactID"])).AttachmentID); string path = attachment.FindPath(AttachmentID); achieve.AttachmentID = AttachmentID; achieve.PactID = Convert.ToInt32(Session["PactID"]); achieve.IsPass = true; BLLPact.update(achieve);//插入文件表 PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功")); } catch (Exception ex) { pm.SaveError(ex, this.Request); } }
//行点击事件 protected void Grid_Files_RowCommand(object sender, GridCommandEventArgs e) { BLHelper.BLLUser user = new BLHelper.BLLUser(); try { string Person = Grid_Equipment.Rows[e.RowIndex].Values[2].ToString(); string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Person != username && Convert.ToInt32(Session["SecrecyLevel"]) != 5) { string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!"; CBoxSelect.SetCheckedState(e.RowIndex, false); Alert.ShowInTop(str); } if (pm.GridCount(Grid_Equipment, CBoxSelect).Count == 0) { btnDelete.Enabled = false; return; } if (pm.GridCount(Grid_Equipment, CBoxSelect).Count != 0) { btnDelete.Enabled = true; return; } } catch (Exception ex) { pm.SaveError(ex, this.Request); } }
public void check() { if (DropDownListContract.SelectedText == "全部") { //Grid_LibraryRecord_Contract.PageIndex = 0; //Grid_LibraryRecord_Contract.PageSize = 20; BindData(); return; } //BindData(); else { page = 1; Grid_LibraryRecord_Contract.PageIndex = 0; string ContractHeadline = DropDownListContract.SelectedText; //int ContractID = BLLContract.FindByContractHeadLine(ContractHeadline).ContractID; //int ContractID = BLLLibraryRecord. List <Common.Entities.LibraryRecord> list = new List <Common.Entities.LibraryRecord>(); //非管理员查询 if (Convert.ToInt32(Session["SecrecyLevel"]) != 5) { //根据资料编号和用户名(非管理员)查询借阅信息 //string UserName = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; int UserID = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserInfoID; list = BLLLibraryRecord.FindRecordByContractHeadLine(DropDownListContract.SelectedText, UserID); } //管理员查询 else { list = BLLLibraryRecord.FindByContractHeadLine(DropDownListContract.SelectedText); } if (list != null) { //Grid_LibraryRecord_Contract.PageIndex = 0; //Grid_LibraryRecord_Contract.PageSize = 20; var res = list.Skip(Grid_LibraryRecord_Contract.PageIndex * Grid_LibraryRecord_Contract.PageSize).Take(Grid_LibraryRecord_Contract.PageSize).ToList(); Grid_LibraryRecord_Contract.RecordCount = list.Count(); Grid_LibraryRecord_Contract.DataSource = res; Grid_LibraryRecord_Contract.DataBind(); btnDelete.Enabled = false; } else { return; } } }
//保存 protected void Save_Click(object sender, EventArgs e) { try { if (tUser.Text.Trim() == "") { Alert.Show("人员姓名不能为空!"); return; } if (tStudyPlace.Text.Trim() == "") { Alert.Show("进修地点不能为空!"); return; } if (tStudySchool.Text.Trim() == "") { Alert.Show("进修学校为空!"); return; } if (tContent.Text.Trim() == "") { Alert.Show("进修内容不能为空!"); return; } if (tDEndTime.SelectedDate < tDBegainTime.SelectedDate) { Alert.ShowInTop("结束时间不能小于开始时间!"); return; } if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { dfurtherstudy.DFurtherStudyID = Convert.ToInt32(Session["ID"]); dfurtherstudy.IsPass = true; UpdateValue(); df.Update(dfurtherstudy); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功")); } else { UpdateValue(); dfurtherstudy.IsPass = false; df.Insert(dfurtherstudy); log.LoginName = user.FindByLoginName(Session["LoginName"].ToString()).UserName; log.OperationTime = DateTime.Now; log.LoginIP = " "; log.OperationContent = "DFurtherStudy"; log.OperationType = "更新"; log.OperationDataID = Convert.ToInt32(Session["ID"]); log.Remark = dfurtherstudy.DFurtherStudyID.ToString(); op.Insert(log); df.ChangePass(Convert.ToInt32(Session["ID"]), false); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!")); } } catch (Exception ex) { pm.SaveError(ex, this.Request); } }
protected void Grid_LibraryRecord_Pact_RowCommand(object sender, FineUI.GridCommandEventArgs e) { int LibraryRecordID = Convert.ToInt32(Grid_LibraryRecord_Pact.DataKeys[e.RowIndex][0].ToString()); //string Person = BLLLibraryRecord.FindByLibreryRecordID(LibraryRecordID).EntryPerson; string Person = Grid_LibraryRecord_Pact.Rows[e.RowIndex].Values[2].ToString(); string strs = Session["LoginName"].ToString(); strs = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Person != strs && Convert.ToInt32(Session["SecrecyLevel"]) != 5) { string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!"; BoxSelect_PactRecord.SetCheckedState(e.RowIndex, false); Alert.ShowInTop(str); } int m; //取整数(不是四舍五入,全舍) int Pages = (int)Math.Floor(Convert.ToDouble(Grid_LibraryRecord_Pact.RecordCount / this.Grid_LibraryRecord_Pact.PageSize)); 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; } List <int> selections = new List <int>(); for (int i = 0; i < m; i++) { if (BoxSelect_PactRecord.GetCheckedState(i)) { selections.Add(i); } } if (selections.Count == 0) { btnDelete.Enabled = false; //Alert.ShowInTop("请至少选择一项!"); return; } else { btnDelete.Enabled = true; } }
//保存 protected void Save_Click(object sender, EventArgs e) { try { if (tAchievement.Text.Trim() == "") { Alert.Show("成果名称不能为空!"); return; } if (tAwardName.Text.Trim() == "") { Alert.Show("报奖名称不能为空!"); return; } if (tAwardGrade.Text.Trim() == " ") { Alert.Show("报奖等级不能为空!"); return; } if (tAwardType.Text.Trim() == "") { Alert.Show("报奖类型不能为空!"); return; } if (AwardPeople.Text.Trim() == "") { Alert.Show("报奖人不能为空!"); return; } string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; ac.EntryPerson = username; if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { InsertValue(); ac.IsPass = true; award.Insert(ac); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!")); } else { InsertValue(); ac.IsPass = false; award.Insert(ac); log.LoginName = username; log.OperationTime = DateTime.Now; log.LoginIP = " "; log.OperationContent = "AchieveAward"; log.OperationType = "添加"; log.OperationDataID = ac.AchieveAwardID; op.Insert(log); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!")); } } catch (Exception ex) { pm.SaveError(ex, this.Request); } }
public void BindData() { try { List <UserInfo> userlist = bllUser.FindByLoginName(Session["LoginName"].ToString(), Convert.ToInt32(Session["SecrecyLevel"])).ToList(); UserInfo user = userlist.FirstOrDefault(); UserName.Text = bllUser.FindByUserID(user.UserInfoID); if (user.Sex == true) { Sex.Text = "女"; } else { Sex.Text = "男"; } Nation.Text = user.Nation; Hometown.Text = user.Hometown; Birth.Text = user.Birth.Value.ToShortDateString(); AgencyID.Text = bllAgency.FindAgenName(user.AgencyID); string[] SecrecyLevels = new string[] { "四级", "三级", "二级", "一级", "管理员" }; //string[] SecrecyLevels = new string[] { "公开", "内部", "秘密", "机密", "管理员" }; SecrecyLevel.Text = SecrecyLevels[Convert.ToInt32(Session["SecrecyLevel"]) - 1]; //TextAreaSearch.Text = "研究方向: " + user.ResearchDirection + "。专长:" + user.Specialty + "。"; if (!string.IsNullOrEmpty(user.ResearchDirection)) { TextAreaResearchDirection.Text = user.ResearchDirection; } else { TextAreaResearchDirection.Text = "暂无"; } if (!string.IsNullOrEmpty(user.Specialty)) { TextAreaSpecialty.Text = user.Specialty; } else { TextAreaSpecialty.Text = "暂无"; } SelectByEducation(); SelectByWork(); SelectByEduE(); FindUrl(); } catch (Exception ex) { pm.SaveError(ex, this.Request); } }
//删除 protected void btnDelete_Click(object sender, EventArgs e) { try { string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { for (int i = 0; i < pm.GridCount(Grid_UnitInspect, CBoxSelect).Count(); i++) { int attachid = inspect.Delete(Convert.ToInt32(Grid_UnitInspect.DataKeys[pm.GridCount(Grid_UnitInspect, CBoxSelect)[i]][0].ToString())); string path = at.FindPath(attachid); if (path != "") { pm.DeleteFile(attachid, path); } } InitData(); Alert.ShowInTop("删除数据成功!"); btnSelect_All.Text = "全选"; } else { for (int i = 0; i < pm.GridCount(Grid_UnitInspect, CBoxSelect).Count(); i++) { inspect.ChangePass(Convert.ToInt32(Grid_UnitInspect.DataKeys[pm.GridCount(Grid_UnitInspect, CBoxSelect)[i]][0]), false); operate.LoginName = username; operate.OperationTime = DateTime.Now; operate.LoginIP = " "; operate.OperationContent = "UnitInspect"; operate.OperationType = "删除"; operate.OperationDataID = Convert.ToInt32(Grid_UnitInspect.DataKeys[pm.GridCount(Grid_UnitInspect, CBoxSelect)[i]][0]); op.Insert(operate); } InitData(); Alert.ShowInTop("您的数据已提交,请等待确认!"); btnSelect_All.Text = "全选"; } } catch (Exception ex) { pm.SaveError(ex, this.Request); } }
//删除 protected void btnDelete_Click(object sender, EventArgs e) { try { List <int> selections = publicmethod.GridCount(GridSocialPartTime, CBoxSelect); if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { for (int i = 0; i < selections.Count(); i++) { bllSocial.Delete(Convert.ToInt32(GridSocialPartTime.DataKeys[selections[i]][0])); } BindData(); btnSelect_All.Text = "全选"; Alert.ShowInTop("删除数据成功!"); } else { for (int i = 0; i < selections.Count(); i++) { bllSocial.UpdateIsPass(Convert.ToInt32(GridSocialPartTime.DataKeys[selections[i]][0]), false); //向操作日志表中插入 OperationLog operate = new OperationLog(); operate.LoginName = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName; operate.LoginIP = ""; operate.OperationType = "删除"; operate.OperationContent = "SocialPartTime"; operate.OperationDataID = Convert.ToInt32(GridSocialPartTime.DataKeys[selections[i]][0]); operate.OperationTime = System.DateTime.Now; operate.Remark = ""; bllOperate.Insert(operate); } btnSelect_All.Text = "全选"; Alert.ShowInTop("您的操作已提交,请等待审核!"); BindData(); } } catch (Exception ex) { publicmethod.SaveError(ex, this.Request); } }
//获取合同借阅信息 public Common.Entities.LibraryRecord FindLibraryRecord() { LibraryRecord.BorrowTime = DatePicker_BorrowTime.SelectedDate; //LibraryRecord.EntryPerson = Session["LoginName"].ToString(); LibraryRecord.EntryPerson = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; LibraryRecord.IsPass = true; LibraryRecord.ContractID = BLLPact.FindByPactNum(txtPactNum.Text).PactID; LibraryRecord.ReturnTime = DatePicker_ReturnTime.SelectedDate; LibraryRecord.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedValue); LibraryRecord.Sort = "合同"; LibraryRecord.UserInfoID = BLLUser.FindByUserName(txtBorrowPeople.Text).UserInfoID; return(LibraryRecord); }
//获取借阅信息 public Common.Entities.LibraryRecord FindLibraryRecord() { LibraryRecord.BorrowTime = Convert.ToDateTime(DatePicker_BorrowTime.Text); //LibraryRecord.EntryPerson = Session["LoginName"].ToString(); LibraryRecord.EntryPerson = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; LibraryRecord.IsPass = true; //LibraryRecord.ContractID = BLLContract.FindByContractHeadLine(txtContractName.Text, Convert.ToInt32(Session["SecrecyLevel"])).ContractID; LibraryRecord.ContractID = Convert.ToInt32(Request.QueryString["id"].ToString()); LibraryRecord.ReturnTime = DatePicker_ReturnTime.SelectedDate; LibraryRecord.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedValue); LibraryRecord.Sort = "资料"; LibraryRecord.UserInfoID = BLLUser.FindByUserName(txtBorrowPeople.Text).UserInfoID; return(LibraryRecord); }
protected void Grid_MeetingName_RowCommand(object sender, FineUI.GridCommandEventArgs e) { //checkbox选择 如果不是录入人或超级管理员操作,则没有操作权限;若录入人不是超级管理员 在进行操作后会向管理员发送相应信息,管理员同意后,才会真正进行 string strs = Session["LoginName"].ToString(); strs = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; string Person = Grid_MeetingName.Rows[e.RowIndex].Values[2].ToString(); if (Person != strs && Convert.ToInt32(Session["SecrecyLevel"]) != 5)//不是录入人或超级管理员操作 { string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!"; CBoxSelect_MeetingName.SetCheckedState(e.RowIndex, false); Alert.ShowInTop(str); } int m; //取整数(不是四舍五入,全舍) int Pages = (int)Math.Floor(Convert.ToDouble(Grid_MeetingName.RecordCount / this.Grid_MeetingName.PageSize)); if (Grid_MeetingName.PageIndex == Pages) { m = (Grid_MeetingName.RecordCount - this.Grid_MeetingName.PageSize * Grid_MeetingName.PageIndex); } else { m = this.Grid_MeetingName.PageSize; } List <int> selections = new List <int>(); for (int i = 0; i < m; i++) { if (CBoxSelect_MeetingName.GetCheckedState(i)) { selections.Add(i); } } if (selections.Count == 0) { btnDelete.Enabled = false; //Alert.ShowInTop("请至少选择一项!"); return; } else { btnDelete.Enabled = true; } }
//保存通知公告信息 protected void btnSave_Click(object sender, EventArgs e) { if (txtHeadLine.Text.Trim() == "") { Alert.ShowInTop("标题不能为空!"); txtHeadLine.Reset(); return; } NewAnnouncement.HeadLine = txtHeadLine.Text; NewAnnouncement.AnnouncementSortName = DropDownList_Sort.SelectedItem.Text; NewAnnouncement.Time = DatePicker_Time.SelectedDate; NewAnnouncement.SourceAgency = txtSourceAgency.Text; //NewAnnouncement.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedText); NewAnnouncement.SecrecyLevel = 1; NewAnnouncement.EntryPerson = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; NewAnnouncement.IsPass = true; int AttachID = pm.UpLoadFile(fileupload).Attachid; switch (AttachID) { case -1: Alert.ShowInTop("文件类型不符,请重新选择!"); return; case 0: Alert.ShowInTop("文件名已经存在!"); return; case -2: Alert.ShowInTop("文件不能大于150M"); return; case -3: Alert.ShowInTop("请上传附件"); return; default: NewAnnouncement.AttachmentID = AttachID; break; } BLLAnnouncement.Insert(NewAnnouncement); Alert.ShowInTop("通知公告信息添加成功!"); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference()); }
//删除选择行的点击事件 protected void btnDelete_Click(object sender, EventArgs e) { BLHelper.BLLOperationLog op = new BLHelper.BLLOperationLog(); OperationLog operate = new OperationLog(); BLHelper.BLLUser user = new BLHelper.BLLUser(); try { string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { for (int i = 0; i < pm.GridCount(Grid_Equipment, CBoxSelect).Count(); i++) { bllequipment.Delete(Convert.ToInt32(Grid_Equipment.DataKeys[pm.GridCount(Grid_Equipment, CBoxSelect)[i]][0].ToString())); } InitData(); btnSelect_All.Text = "全选"; Alert.ShowInTop("删除数据成功!"); } else { for (int i = 0; i < pm.GridCount(Grid_Equipment, CBoxSelect).Count(); i++) { bllequipment.UpdateIsPass(Convert.ToInt32(Grid_Equipment.DataKeys[pm.GridCount(Grid_Equipment, CBoxSelect)[i]][0]), false); operate.LoginName = username; operate.OperationTime = DateTime.Now; operate.LoginIP = " "; operate.OperationContent = "Equipments"; operate.OperationType = "删除"; operate.OperationDataID = Convert.ToInt32(Grid_Equipment.DataKeys[pm.GridCount(Grid_Equipment, CBoxSelect)[i]][0]); op.Insert(operate); } InitData(); btnSelect_All.Text = "全选"; Alert.ShowInTop("您的数据已提交,请等待确认!"); } } catch (Exception ex) { pm.SaveError(ex, this.Request); } }
//行点击 protected void gd_UnitAPeople_RowCommand(object sender, GridCommandEventArgs e) { string person = gd_UnitAPeople.Rows[e.RowIndex].Values[0].ToString(); BLHelper.BLLUser user = new BLHelper.BLLUser(); string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Convert.ToInt32(Session["SecrecyLevel"]) != 5 && person != username) { string str = "您没有对此行操作的权限!此行为" + person + "录入,请与管理员联系!"; Alert.ShowInTop(str); CBoxSelect.SetCheckedState(e.RowIndex, false); } if (pm.GridCount(gd_UnitAPeople, CBoxSelect).Count == 0) { btn_Delete.Enabled = false; } else { btn_Delete.Enabled = true; } }
//行点击事件 protected void Grid_FurtherStudy_RowCommand(object sender, GridCommandEventArgs e) { string Person = Grid_FurtherStudy.Rows[e.RowIndex].Values[0].ToString(); BLHelper.BLLUser user = new BLHelper.BLLUser(); string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Person != username && Convert.ToInt32(Session["SecrecyLevel"]) != 5) { string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!"; CBoxSelect.SetCheckedState(e.RowIndex, false); Alert.ShowInTop(str); } if (pm.GridCount(Grid_FurtherStudy, CBoxSelect).Count == 0) { btnDelete.Enabled = false; } else { btnDelete.Enabled = true; } }
//保存 protected void Save_Click(object sender, EventArgs e) { try { if (T_UserInfoID.Text.Trim() != "") { if (bllUser.IsUser(T_UserInfoID.Text.Trim()) != null) { if (bllUser.IsUser(T_UserInfoID.Text.Trim()).IsPass == true) { if (T_Sno.Text.Trim() == "") { Alert.ShowInTop("学号不能为空!"); T_Sno.Text = ""; return; } if (T_SName.Text.Trim() == "") { Alert.ShowInTop("姓名不能为空!"); T_SName.Text = ""; return; } if (T_Specialty.Text.Trim() == "") { Alert.ShowInTop("专业不能为空!"); T_Specialty.Text = ""; return; } if (T_SResearch.Text.Trim() == "") { Alert.ShowInTop("研究方向不能为空!"); T_SResearch.Text = ""; return; } if (bllStudent.IsSnoAndTeacher(T_Sno.Text.Trim(), Convert.ToInt32(bllUser.FindID(T_UserInfoID.Text.Trim().ToString()))) == null) { Student newstudent = new Student(); newstudent.Sno = T_Sno.Text.Trim(); newstudent.Sname = T_SName.Text.Trim(); if (rbtnBoy.Checked == true) { newstudent.Sex = true; } else { newstudent.Sex = false; } newstudent.DocumentType = DropDownListDocumentType.SelectedItem.Text; newstudent.DocumentNumber = T_DocumentNumber.Text.Trim(); newstudent.Contact = T_Contact.Text.Trim(); if (IsGraduation.Checked == true) { newstudent.IsGraduation = true; } else { newstudent.IsGraduation = false; } newstudent.Specialty = T_Specialty.Text.Trim(); newstudent.SResearch = T_SResearch.Text.Trim(); newstudent.SGraduationDirection = T_SGraduationDirection.Text.Trim(); newstudent.Type = DropDownListType.SelectedItem.Text; newstudent.UserInfoID = bllUser.FindID(T_UserInfoID.Text); newstudent.EnterTime = DatePickerEnterTime.SelectedDate; newstudent.AgencyID = BLLAgency.SelectAgencyID(DropDownList_Agency.SelectedText); if (DatePickerGraduationTime.SelectedDate.HasValue) { if (DatePickerGraduationTime.SelectedDate < DatePickerEnterTime.SelectedDate) { Alert.ShowInTop("毕业时间不能小于入学时间!"); return; } else { newstudent.GraduationTime = DatePickerGraduationTime.SelectedDate; } } newstudent.SecrecyLevel = DropDownListSecrecyLevel.SelectedIndex + 1; newstudent.EntryPerson = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Convert.ToInt32(Session["SecrecyLevel"]) != 5) { newstudent.IsPass = false; bllStudent.InsertForPeople(newstudent);//插入学生情况表 OperationLog operate = new OperationLog(); operate.LoginName = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName; operate.LoginIP = ""; operate.OperationType = "添加"; operate.OperationContent = "Student"; operate.OperationDataID = bllStudent.SelectByStudentID(newstudent.Sno); operate.OperationTime = System.DateTime.Now; operate.Remark = ""; bllOperate.Insert(operate);//插入操作表 PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("学生情况信息已提交审核!")); } else { newstudent.IsPass = true; bllStudent.InsertForPeople(newstudent);//插入学生情况表 PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("学生情况信息已添加完成!")); } } else { Alert.ShowInTop("已存在学号为" + T_Sno.Text + ", 授课老师为" + T_UserInfoID.Text + "的信息"); T_Sno.Text = ""; } } else { Alert.ShowInTop("授课老师尚未通过审核!"); } } else { Alert.ShowInTop("授课老师不存在!"); T_UserInfoID.Text = ""; } } else { Alert.ShowInTop("授课老师不能为空!"); T_UserInfoID.Text = ""; return; } } catch (Exception ex) { publicmethod.SaveError(ex, this.Request); } }
//保存更改 protected void Save_Click(object sender, EventArgs e) { try { if (tInspectName.Text.Trim() == "") { Alert.Show("姓名不能为空!"); return; } if (tWorkPlace.Text.Trim() == "") { Alert.Show("工作单位不能不空!"); return; } if (tVisitContent.Text.Trim() == "") { Alert.Show("参观内容不能为空!"); return; } BLHelper.BLLAgency agency = new BLHelper.BLLAgency(); ins.EntryPerson = inspect.Findmodel(Convert.ToInt32(Session["InspectID"])).EntryPerson; ins.InspectName = tInspectName.Text.Trim(); ins.VisitContent = tVisitContent.Text.Trim(); ins.InspectTime = dInspectTime.SelectedDate; ins.WorkPlace = tWorkPlace.Text.Trim(); ins.SecrecyLevel = Convert.ToInt32(dSecrecyLevel.SelectedIndex + 1); ins.AgencyID = agency.SelectAgencyID(DropDownListAgency.SelectedText); ins.Duty = tDuty.Text.Trim(); int AttachmentID = inspect.FindAttachmentID(Convert.ToInt32(Session["InspectID"])); string path = attachment.FindPath(AttachmentID); string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { ins.IsPass = true; ins.UnitInspectID = Convert.ToInt32(Session["InspectID"]); int Attachment = pm.UpLoadFile(fileupload).Attachid; if (Attachment != -3) { switch (Attachment) { case -1: Alert.ShowInTop("文件类型不符,请重新选择!"); return; case 0: Alert.ShowInTop("文件名已经存在!"); return; case -2: Alert.ShowInTop("文件不能大于150M"); return; } ins.AccessoryID = Attachment; inspect.Update(ins); pm.DeleteFile(AttachmentID, path); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!")); } else { if (AttachmentID != 0) { ins.AccessoryID = AttachmentID; } inspect.Update(ins); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!")); } } else { log.LoginName = username; log.OperationTime = DateTime.Now; log.LoginIP = " "; log.OperationContent = "UnitInspect"; log.OperationType = "更新"; ins.IsPass = false; int Attachment = pm.UpLoadFile(fileupload).Attachid; if (Attachment != -3) { switch (Attachment) { case -1: Alert.ShowInTop("文件类型不符,请重新选择!"); return; case 0: Alert.ShowInTop("文件名已经存在!"); return; case -2: Alert.ShowInTop("文件不能大于150M"); return; } ins.AccessoryID = Attachment; inspect.Insert(ins); log.OperationDataID = Convert.ToInt32(Session["InspectID"]); log.Remark = ins.UnitInspectID.ToString(); op.Insert(log); inspect.ChangePass(Convert.ToInt32(Session["InspectID"]), false); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!")); } else { if (AttachmentID != 0) { ins.AccessoryID = AttachmentID; } inspect.Insert(ins); log.OperationDataID = Convert.ToInt32(Session["InspectID"]); log.Remark = ins.UnitInspectID.ToString(); op.Insert(log); inspect.ChangePass(Convert.ToInt32(Session["InspectID"]), false); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!")); } } } catch (Exception ex) { int attachid = Convert.ToInt32(ins.AccessoryID); string path = attachment.FindPath(attachid); pm.DeleteFile(attachid, path); pm.SaveError(ex, this.Request); } }
//保存 protected void Save_Click(object sender, EventArgs e) { try { if (txtReportPeople.Text.Trim() == "") { Alert.ShowInTop("姓名不能为空!"); txtReportPeople.Reset(); return; } if (txtReportUnit.Text.Trim() == "") { Alert.ShowInTop("报告人单位不能为空!"); txtReportUnit.Reset(); return; } if (txtReportName.Text.Trim() == "") { Alert.ShowInTop("学术报告名称不能为空!"); txtReportName.Reset(); return; } if (txtReportPlace.Text.Trim() == "") { Alert.ShowInTop("报告地点不能为空!"); txtReportPlace.Reset(); return; } if (DatePikerReportTime.Text == "") { Alert.ShowInTop("报告时间不能为空!"); DatePikerReportTime.Reset(); return; } if (txtPeopleCount.Text.Trim() == "") { Alert.ShowInTop("参与人数不能为空!"); txtPeopleCount.Reset(); return; } newacademicreporting.ReportTime = Convert.ToDateTime(DatePikerReportTime.Text); newacademicreporting.PeopleCount = Convert.ToInt32(txtPeopleCount.Text.Trim()); newacademicreporting.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedValue); newacademicreporting.Remark = txtRemark.Text; newacademicreporting.ReportPeople = txtReportPeople.Text; newacademicreporting.JobName = txtJobName.Text; newacademicreporting.JobMission = txtJobMission.Text; newacademicreporting.ReportUnit = txtReportUnit.Text; newacademicreporting.Report = txtReport.Text; newacademicreporting.ReportTele = txtReportTele.Text; newacademicreporting.AcademicTitle = txtAcademicTitle.Text; newacademicreporting.ReportName = txtReportName.Text; newacademicreporting.ReportPlace = txtReportPlace.Text; newacademicreporting.ApplyFund = txtApplyFund.Text; newacademicreporting.Organizers = txtOrganizers.Text; newacademicreporting.Coorganizer = txtCoorganizer.Text; newacademicreporting.ReportType = txtReportType.Text; newacademicreporting.MajorPeople = txtMajorPeople.Text; //用户等级为5级可直接通过 if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { newacademicreporting.IsPass = true; } else { newacademicreporting.IsPass = false; } newacademicreporting.EntryPerson = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; int AttachID = pm.UpLoadFile(fileupload).Attachid; switch (AttachID) { case -1: Alert.ShowInTop("文件类型不符,请重新选择!"); return; case 0: Alert.ShowInTop("文件名已经存在!"); return; case -2: Alert.ShowInTop("文件不能大于150M"); return; case -3: newacademicreporting.AttachmentID = null; break; //Alert.ShowInTop("请上传附件"); //return; default: newacademicreporting.AttachmentID = AttachID; break; } //向学术报告表中插入信息 BLLNAR.Insert(newacademicreporting); if (Convert.ToInt32(Session["SecrecyLevel"]) != 5) { //操作日志表对象 Common.Entities.OperationLog operationLog = InsertOperationLog(); operationLog.OperationDataID = newacademicreporting.NewAcademicReportingID; BLLOL.Insert(operationLog); Alert.ShowInTop("您的数据已提交,请等待确认"); //PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("数据已缓存,正在等待审核!")); //return; } else { Alert.ShowInTop("保存成功"); } PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference()); } catch (Exception ex) { //删除附件文件 string path = BLLattachment.FindPath(Convert.ToInt32(newacademicreporting.AttachmentID)); if (path != "") { pm.DeleteFile(Convert.ToInt32(newacademicreporting.AttachmentID), path); //删除附件表中的数据 BLLattachment.Delete(Convert.ToInt32(newacademicreporting.AttachmentID));//删除成功返回true } //BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } //PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!")); }
//保存 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 btnSave_Click(object sender, EventArgs e) { try { if (Session["LoginName"].ToString() == "") { Response.Redirect("login.aspx"); Alert.Show("登录超时!"); } if (txtContractHeadLine.Text.Trim() == "") { Alert.ShowInTop("资料题目不能为空!"); txtContractHeadLine.Reset(); return; } if (txtContractAuthors.Text.Trim() == "") { Alert.ShowInTop("资料保存人不能为空!"); txtContractAuthors.Reset(); return; } if (txtContractOriginal.Text.Trim() == "") { Alert.ShowInTop("原始文件保存人不能为空 ! "); txtContractOriginal.Reset(); return; } NewContract.ContractAuthors = txtContractAuthors.Text; NewContract.ContractHeadLine = txtContractHeadLine.Text; NewContract.ContractOriginal = txtContractOriginal.Text; NewContract.EntryPerson = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; NewContract.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedValue); //上传附件 int AttachID = pm.UpLoadFile(fileupload).Attachid; switch (AttachID) { case -1: Alert.ShowInTop("文件类型不符,请重新选择!"); return; case 0: Alert.ShowInTop("文件名已经存在!"); return; case -2: Alert.ShowInTop("文件不能大于150M"); return; case -3: NewContract.AttachmentID = null; break; //Alert.ShowInTop("请上传附件"); //return; default: NewContract.AttachmentID = AttachID; break; } if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { NewContract.IsPass = true; //向资料表中插入数据 BLLcontract.Insert(NewContract); Alert.ShowInTop("保存成功"); } else { NewContract.IsPass = false; //向资料表中插入数据 BLLcontract.Insert(NewContract); //向操作日志表中插入信息 operationLog.LoginIP = " "; operationLog.LoginName = Session["LoginName"].ToString(); operationLog.OperationType = "添加"; operationLog.OperationContent = "Contract"; operationLog.OperationTime = DateTime.Now; operationLog.OperationDataID = NewContract.ContractID; //向操作日志表中插入数据 BLLOL.Insert(operationLog); Alert.ShowInTop("您的数据已提交,请等待确认"); } PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference()); } catch (Exception ex) { int ContractID = NewContract.ContractID; //删除资料附件 int AttactID = BLLcontract.FindAttachmentID(ContractID); string strPath; if (AttactID != 0) { strPath = BLLattachment.FindPath(AttactID); if (strPath != "") { //删除附件文件 pm.DeleteFile(AttactID, strPath); //在附件表中删除附件数据 BLLattachment.Delete(AttactID); } } //BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//保存 protected void Save_Click(object sender, EventArgs e) { try { if (tPatentName.Text.Trim() == "") { Alert.Show("专利名称不能为空!"); return; } if (tPatentNumber.Text.Trim() == "") { Alert.Show("专利号不能为空!"); return; } if (tGivenUnit.Text.Trim() == "") { Alert.Show("授予机构不能为空!"); return; } if (tState.Text.Trim() == "") { Alert.Show("状态不能为空!"); return; } if (PatentPeople.Text.Trim() == "") { Alert.Show("全部发明人不能为空!"); return; } if (FirstPeople.Text.Trim() == "") { Alert.Show("第一发明人不能为空!"); return; } if (tAccreditTime.SelectedDate < tApplicationTime.SelectedDate) { Alert.ShowInTop("授权时间不能小于申请时间!"); return; } string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; pa.EntryPerson = username; //pa.Member = PatentMember.Text.Trim(); List <string> list = new List <string>(); string unit = ""; list.Add(tPatentDepartment1.Text.ToString()); list.Add(tPatentDepartment2.Text.ToString()); list.Add(tPatentDepartment3.Text.ToString()); List <string> newlist = new List <string>(); for (int i = 0; i < 3; i++) { if (!string.IsNullOrEmpty(list[i].ToString())) { newlist.Add(list[i].ToString()); } } if (newlist.Count != 0) { for (int j = 0; j < newlist.Count; j++) { unit += newlist[j].ToString(); if (j == newlist.Count() - 1) { break; } unit += ","; } pa.PatentDepartment = unit; } else { pa.PatentDepartment = null; } if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { InsertValue(); pa.IsPass = true; //lby ↓ int attachid = pm.UpLoadFile(PatentFile).Attachid; switch (attachid) { case -1: Alert.ShowInTop("专利证书文件类型不符,请重新选择!"); return; case 0: Alert.ShowInTop("专利证书文件名已经存在!"); return; case -2: Alert.ShowInTop("专利证书文件不能大于150M"); return; } if (attachid != -3) { pa.Attachment_Patent = attachid; } else { pa.Attachment_Patent = null; } attachid = pm.UpLoadFile(ApplicationFile).Attachid; switch (attachid) { case -1: Alert.ShowInTop("申请书文件类型不符,请重新选择!"); return; case 0: Alert.ShowInTop("申请书文件名已经存在!"); return; case -2: Alert.ShowInTop("申请书文件不能大于150M"); return; } if (attachid != -3) { pa.Attachment_Application = attachid; } else { pa.Attachment_Application = null; } if (tAchievement.SelectedItem != null) { pa.AchievementID = tAchievement.SelectedItem.Text; } else { pa.AchievementID = tAchievement.Text; } patent.Insert(pa); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!")); } else { InsertValue(); pa.IsPass = false; //lby ↓ int attachid = pm.UpLoadFile(PatentFile).Attachid; switch (attachid) { case -1: Alert.ShowInTop("专利证书文件类型不符,请重新选择!"); return; case 0: Alert.ShowInTop("专利证书文件名已经存在!"); return; case -2: Alert.ShowInTop("专利证书文件不能大于150M"); return; } if (attachid != -3) { pa.Attachment_Patent = attachid; } else { pa.Attachment_Patent = null; } attachid = pm.UpLoadFile(ApplicationFile).Attachid; switch (attachid) { case -1: Alert.ShowInTop("申请书文件类型不符,请重新选择!"); return; case 0: Alert.ShowInTop("申请书文件名已经存在!"); return; case -2: Alert.ShowInTop("申请书文件不能大于150M"); return; } if (attachid != -3) { pa.Attachment_Application = attachid; } else { pa.Attachment_Application = null; } patent.Insert(pa); operate.LoginName = username; operate.OperationTime = DateTime.Now; operate.LoginIP = " "; operate.OperationContent = "Patent"; operate.OperationType = "添加"; operate.OperationDataID = pa.PatentID; op.Insert(operate); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!")); } } catch (Exception ex) { //lby ↓ if (pa.Attachment_Patent != null && pa.Attachment_Application != null) { int[] attachid = { pa.Attachment_Patent.Value, pa.Attachment_Application.Value }; string path_Patent = at.FindPath(attachid[0]); string path_Application = at.FindPath(attachid[1]); pm.DeleteFile(attachid[0], path_Patent); pm.DeleteFile(attachid[1], path_Application); } pm.SaveError(ex, this.Request); } }
//保存机构信息 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 Save_Click(object sender, EventArgs e) { try { if (UserInfoName.Text.Trim() != "") { if (bllUser.IsUser(UserInfoName.Text.Trim()) != null) { if (bllUser.IsUser(UserInfoName.Text.Trim()).IsPass == true) { if (WorkUnit.Text.Trim() == "") { Alert.ShowInTop("工作单位不能为空!"); WorkUnit.Text = ""; return; } if (Post.Text.Trim() == "") { Alert.ShowInTop("职务不能为空!"); Post.Text = ""; return; } if (JobTitle.Text.Trim() == "") { Alert.ShowInTop("职称不能为空!"); JobTitle.Text = ""; return; } WorkExperience work = new WorkExperience(); work.UserInfoID = bllUser.FindID(UserInfoName.Text.Trim()); work.StartTime = DatePickerStartTime.SelectedDate; if (DatePickerEndTime.SelectedDate.HasValue) { if (DatePickerEndTime.SelectedDate < DatePickerStartTime.SelectedDate) { Alert.ShowInTop("结束时间不能小于开始时间!"); return; } else { work.EndTime = DatePickerEndTime.SelectedDate; } } work.PartTimeUnit = PartTimeUnit.Text.Trim(); work.JobTitle = JobTitle.Text.Trim(); work.Post = Post.Text.Trim(); work.WorkUnit = WorkUnit.Text.Trim(); work.SecrecyLevel = DropDownListSecrecyLevel.SelectedIndex + 1; work.EntryPerson = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName; work.Remark = Remark.Text.Trim(); if (Convert.ToInt32(Session["SecrecyLevel"]) != 5) { work.IsPass = false; bllWork.InsertForPeople(work);//插入工作经历表 OperationLog operate = new OperationLog(); operate.LoginName = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName; operate.LoginIP = ""; operate.OperationType = "添加"; operate.OperationContent = "WorkExperience"; operate.OperationDataID = work.WorkExperienceID; operate.OperationTime = System.DateTime.Now; operate.Remark = ""; bllOperate.Insert(operate);//插入操作表 PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员工作经历信息已提交审核!")); } else { work.IsPass = true; bllWork.InsertForPeople(work);//插入工作经历表 PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员工作经历信息已添加完成!")); } } else { Alert.ShowInTop("该人员正在审核中!"); } } else { Alert.ShowInTop("人员不存在!"); } } else { Alert.ShowInTop("人员不能为空!"); UserInfoName.Text = ""; return; } } catch (Exception ex) { publicmethod.SaveError(ex, this.Request); } }