//返回插入操作日志对象 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 = "ScienceReport"; operationLog.OperationTime = DateTime.Now; return(operationLog); }
//返回插入操作日志对象 public Common.Entities.OperationLog InsertOperationLog() { //向操作日志表插入信息 Common.Entities.OperationLog operationLog = new Common.Entities.OperationLog(); operationLog.LoginIP = " "; operationLog.LoginName = Session["LoginName"].ToString(); operationLog.OperationType = "添加"; operationLog.OperationContent = "NewAcademicReporting"; operationLog.OperationTime = DateTime.Now; 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.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 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 = BLLNAR.FindByNAReportingID(Convert.ToInt32(Session["NewAcademicReporting"])); Newnareporting.ReportTime = Convert.ToDateTime(DatePikerReportTime.Text); Newnareporting.PeopleCount = Convert.ToInt32(txtPeopleCount.Text.Trim()); Newnareporting.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedValue); Newnareporting.Remark = Remark.Text; Newnareporting.ReportPeople = txtReportPeople.Text; Newnareporting.JobName = txtJobName.Text; Newnareporting.JobMission = txtJobMission.Text; Newnareporting.ReportUnit = txtReportUnit.Text; Newnareporting.Report = txtReport.Text; Newnareporting.ReportTele = txtReportTele.Text; Newnareporting.AcademicTitle = txtAcademicTitle.Text; Newnareporting.ReportName = txtReportName.Text; Newnareporting.ReportPlace = txtReportPlace.Text; Newnareporting.ApplyFund = txtApplyFund.Text; Newnareporting.Organizers = txtOrganizers.Text; Newnareporting.Coorganizer = txtCoorganizer.Text; Newnareporting.ReportType = txtReportType.Text; Newnareporting.MajorPeople = txtMajorPeople.Text; Newnareporting.EntryPerson = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; //用户等级为5级可直接通过 if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { Newnareporting.IsPass = true; } else { Newnareporting.IsPass = false; } 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: Newnareporting.AttachmentID = null; break; //Alert.ShowInTop("请上传附件"); //return; default: Newnareporting.AttachmentID = AttachID; break; } if (Convert.ToInt32(Session["SecrecyLevel"]) != 5) { //操作日志表对象 Common.Entities.OperationLog operationLog = InsertOperationLog(); operationLog.OperationDataID = Convert.ToInt32(Session["NewAcademicReportingID"]); Newnareporting.EntryPerson = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; Newnareporting.IsPass = false; newacademicreporting.IsPass = false; BLLNAR.Insert(Newnareporting); operationLog.Remark = Newnareporting.NewAcademicReportingID.ToString(); BLLOL.Insert(operationLog); Alert.ShowInTop("您的数据已提交,请等待确认"); } else { Newnareporting.NewAcademicReportingID = Convert.ToInt32(Session["NewAcademicReportingID"]); BLLNAR.Update(Newnareporting); 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 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 btnSave_Click(object sender, EventArgs e) { try { if (txtLecturesName.Text.Trim() == "") { Alert.ShowInTop("姓名不能为空!"); txtLecturesName.Reset(); return; } if (txtWorkPlace.Text.Trim() == "") { Alert.ShowInTop("工作单位不能为空!"); txtWorkPlace.Reset(); return; } //原单位讲学对象 unitLectures = BLLUL.FindByUnitLecturesID(Convert.ToInt32(Session["UnitLecturesID"])); //单位讲学表对象 NewUnitLectures.LecturesName = txtLecturesName.Text; NewUnitLectures.AgencyID = BLLAgency.SelectAgencyID(DropDownList_Agency.SelectedText); NewUnitLectures.UReportName = txtUReportName.Text; NewUnitLectures.LecturesTime = Convert.ToDateTime(DatePikerLecturesTime.Text); NewUnitLectures.WorkUnit = txtWorkPlace.Text; NewUnitLectures.listenerNumber = Convert.ToInt32(txtlistenerNumber.Text); NewUnitLectures.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedValue); NewUnitLectures.LecturesPlace = txtLecturesPlace.Text; NewUnitLectures.WorkTitle = txtjobtitle.Text; NewUnitLectures.Identity = txtIDCard.Text; NewUnitLectures.Telephone = txtTel.Text; NewUnitLectures.Remark = Remark.Text; NewUnitLectures.EntryPerson = unitLectures.EntryPerson; //用户等级为5级可直接通过 if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { NewUnitLectures.IsPass = true; } else { NewUnitLectures.IsPass = false; } 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: NewUnitLectures.AttachmentID = unitLectures.AttachmentID; break; default: NewUnitLectures.AttachmentID = AttachID; break; } if (Convert.ToInt32(Session["SecrecyLevel"]) != 5) { //操作日志表对象 Common.Entities.OperationLog operationLog = InsertOperationLog(); operationLog.OperationDataID = Convert.ToInt32(Session["UnitLecturesID"]); NewUnitLectures.EntryPerson = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName; NewUnitLectures.IsPass = false; unitLectures.IsPass = false; BLLUL.Insert(NewUnitLectures); //向单位讲学表插入信息 operationLog.Remark = NewUnitLectures.UnitLecturesID.ToString(); BLLOL.Insert(operationLog); //向操作日志表插入信息 Alert.ShowInTop("操数据已经提交,等待管理员确认!"); } else { NewUnitLectures.UnitLecturesID = Convert.ToInt32(Session["UnitLecturesID"]); BLLUL.Update(NewUnitLectures); Alert.ShowInTop("保存成功!"); } PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference()); } catch (Exception ex) { //删除附件文件 string path = BLLattachment.FindPath(Convert.ToInt32(unitLectures.AttachmentID)); if (path != "") { pm.DeleteFile(Convert.ToInt32(unitLectures.AttachmentID), path); //删除附件表中的数据 BLLattachment.Delete(Convert.ToInt32(unitLectures.AttachmentID));//删除成功返回true } //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 = blpro.IsNullProject(tb_ProjectName.Text.Trim()); if (project == null) { tb_ProjectName.Text = ""; Alert.ShowInTop("无此项目,请检查输入!"); return; } else if (project.IsPass == false) { tb_ProjectName.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_BudgetDirector.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.OperateType = "进账"; fun.ProjectID = blpro.SelectProjectID(tb_ProjectName.Text); fun.SecrecyLevel = Convert.ToInt32(ddl_level.SelectedValue) + 1; fun.Time = dp_Time.SelectedDate; if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { fun.IsPass = true; blfund.Insert(fun); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!")); } else { fun.IsPass = false; blfund.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 Save_Click(object sender, EventArgs e) { BLHelper.BLLFurniture blfurni = new BLHelper.BLLFurniture(); BLHelper.BLLUser user = new BLHelper.BLLUser(); BLHelper.BLLAgency agency = new BLHelper.BLLAgency(); BLHelper.BLLOperationLog op = new BLHelper.BLLOperationLog(); Common.Entities.Furniture furniture = new Common.Entities.Furniture(); Common.Entities.OperationLog log = new Common.Entities.OperationLog(); try { if (string.IsNullOrEmpty(tb_FurnitureName.Text.Trim())) { Alert.ShowInTop("请填写家具名称!"); return; } furniture.FurnitureName = tb_FurnitureName.Text.Trim(); if (ddl_isgov.SelectedIndex == 0) { furniture.IsGowerProcu = true; } else { furniture.IsGowerProcu = false; } if (ddl_isshare.SelectedIndex == 0) { furniture.IsShare = true; } else { furniture.IsShare = false; } //furniture.AgencName = tb_Agency.Text.Trim(); furniture.AgencName = ddl_Agency.SelectedText; furniture.CategoryName = "无"; furniture.CategoryName = ddl_Category.SelectedText.Trim(); furniture.ClassNum = tb_ClassNum.Text.Trim(); furniture.EquipNum = tb_Equipnum.Text.Trim(); furniture.Manufacturer = tb_Manufacturer.Text.Trim(); furniture.MeasurementUnit = tb_MeasurementUnit.Text.Trim(); furniture.Model = tb_Model.Text.Trim(); furniture.Remarks = tb_Remarks.Text.Trim(); furniture.StorageLocation = tb_StorageLocation.Text.Trim(); furniture.Price = tb_price.Text.Trim(); furniture.Purchase = tb_Purchase.Text.Trim(); furniture.PurchaseTime = dp_PurchaseTime.SelectedDate.Value; furniture.UsePerson = tb_UsePerson.Text.Trim(); string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; furniture.EntryPerson = username; furniture.SecrecyLevel = Convert.ToInt32(ddl_Level.SelectedIndex + 1); //furniture.AgencyID = agency.SelectAgencyID(ddl_agencyname.SelectedText.Trim()); if (Convert.ToInt32(Session["SecrecyLevel"]) < 5) { log.LoginName = username; log.OperationTime = DateTime.Now; log.LoginIP = " "; log.OperationContent = "Furnitures"; log.OperationType = "添加"; furniture.IsPass = false; blfurni.Insert(furniture);//插入家具表 log.OperationDataID = furniture.FurnitureID; op.Insert(log); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待审核!")); } else { furniture.IsPass = true; blfurni.Insert(furniture);//插入家具表 PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功")); } } catch (Exception ex) { Alert.ShowInTop("保存出错,请联系管理员!"); pm.SaveError(ex, this.Request); } }
//保存 protected void Save_Click(object sender, EventArgs e) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); try { if (tName.Text.Trim() == "") { Alert.ShowInTop("姓名不能为空!"); tName.Text = ""; return; } if (tLearnPlace.Text.Trim() == "") { Alert.ShowInTop("进修地点不能为空!"); tLearnPlace.Text = ""; return; } if (tLearnSchool.Text.Trim() == "") { Alert.ShowInTop("进修学校不能为空!"); tLearnSchool.Text = ""; return; } if (tLearnContent.Text.Trim() == "") { Alert.ShowInTop("进修内容不能为空!"); tLearnContent.Text = ""; return; } if (dLearnEndTime.SelectedDate < dLearnBeginTime.SelectedDate) { Alert.ShowInTop("结束时间不能小于开始时间!"); return; } BLHelper.BLLAgency agency = new BLHelper.BLLAgency(); Common.Entities.OperationLog op = new Common.Entities.OperationLog(); BLHelper.BLLOperationLog blop = new BLHelper.BLLOperationLog(); fur = FutherStudy.FindFurByID(Convert.ToInt32(Session["FurID"])); fur.Name = tName.Text.Trim(); if (dBirthday.SelectedDate != null) { fur.Birthday = Convert.ToDateTime(dBirthday.Text.Trim()); } fur.DocuType = tDocuType.SelectedValue.Trim(); fur.IDNum = tIDNum.Text.Trim(); fur.Email = tEmail.Text.Trim(); fur.Hometown = tHometown.Text.Trim(); fur.LearnBeginTime = Convert.ToDateTime(dLearnBeginTime.Text.Trim()); fur.LearnContent = tLearnContent.Text.Trim(); if (dLearnEndTime.SelectedDate != null) { fur.LearnEndTime = Convert.ToDateTime(dLearnEndTime.Text.Trim()); } fur.LearnPlace = tLearnPlace.Text.Trim(); fur.LearnSchool = tLearnSchool.Text.Trim(); fur.PhoneNum = tPhoneNum.Text.Trim(); fur.Profile = tPintroduce.Text.Trim(); fur.Remark = tRemark.Text.Trim(); fur.SecrecyLevel = Convert.ToInt32(DroSecrecyLevel.SelectedValue.Trim()) + 1; if (rbtnBoy.Checked == true) { fur.Sex = true; } else { fur.Sex = false; } fur.AgencyID = agency.SelectAgencyID(DropDownListAgency.SelectedText); if (Convert.ToInt32(Session["SecrecyLevel"].ToString()) == 5) { fur.FutherStudyID = Convert.ToInt32(Session["FurID"]); fur.IsPass = true; FutherStudy.Update(fur); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!")); } else { fur.IsPass = false; FutherStudy.Insert(fur); op.LoginIP = ""; op.LoginName = Session["LoginName"].ToString(); op.OperationContent = "FutherStudy"; op.OperationDataID = Convert.ToInt32(Session["FurID"]); // op.OperationType = "更新"; op.OperationTime = DateTime.Now; op.Remark = FutherStudy.FindIdByNT(tName.Text.Trim().ToString(), dLearnBeginTime.SelectedDate.Value).ToString(); blop.Insert(op); FutherStudy.UpdateIsPass(Convert.ToInt32(Session["FurID"]), false); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("数据已经提交,请等待管理员确认!")); } } catch (Exception ex) { pm.SaveError(ex, this.Request); } }
//保存 protected void btnSave_Click(object sender, EventArgs e) { try { scienceReport = InserScienceReport(); if (Session["LoginName"].ToString() == "") { Response.Redirect("login.aspx"); Alert.Show("登录超时!"); } if (txtReportName.Text.Trim() == "") { Alert.ShowInTop("报告名称不能为空!"); txtReportName.Reset(); return; } if (txtReportName.Text.Trim() == "") { Alert.ShowInTop("报告名称不能为空!"); txtReportName.Reset(); return; } if (txtReportPeople.Text.Trim() == "") { Alert.ShowInTop("报告人不能为空!"); txtReportPeople.Reset(); return; } //int attachId = publicMethod.UpLoad(fileupload); //Common.Entities.ScienceReport scienceReport = InserScienceReport(); //上传文件并向附件表中插入数据 int AttachID = publicMethod.UpLoadFile(fileupload).Attachid; switch (AttachID) { case -1: Alert.ShowInTop("文件类型不符,请重新选择!"); return; case 0: Alert.ShowInTop("文件名已经存在!"); return; case -2: Alert.ShowInTop("文件不能大于150M"); return; case -3: scienceReport.AccessoryID = null; break; //Alert.ShowInTop("请上传附件"); //return; default: scienceReport.AccessoryID = AttachID; break; } //向学术报告表中插入数据 BLLScience.Insert(scienceReport); Common.Entities.OperationLog OL = InsertOperationLog(); if (Convert.ToInt32(Session["SecrecyLevel"]) != 5) { //向操作日志表中插入数据 OL.OperationDataID = scienceReport.ScienceReportID; operationLog.Insert(OL); Alert.ShowInTop("您的数据已提交,请等待确认"); } else { Alert.ShowInTop("保存成功"); } PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference()); //Reset(); } catch (Exception ex) { int?attachid = scienceReport.AccessoryID; 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); } } BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); return; } }
//保存 protected void Save_Click(object sender, EventArgs e) { BLHelper.BLLEquipment blequip = new BLHelper.BLLEquipment(); BLHelper.BLLUser user = new BLHelper.BLLUser(); BLHelper.BLLAgency agency = new BLHelper.BLLAgency(); BLHelper.BLLOperationLog op = new BLHelper.BLLOperationLog(); Common.Entities.Equipment Equipment = new Common.Entities.Equipment(); Common.Entities.OperationLog log = new Common.Entities.OperationLog(); try { //if (string.IsNullOrEmpty(tb_EquipmenteName.Text.Trim())) //{ // Alert.ShowInTop("请填写设备名称!"); // return; //} Equipment.EquipmentName = tb_EquipmenteName.Text.Trim(); if (ddl_isgov.SelectedIndex == 0) { Equipment.IsGowerProcu = true; } else { Equipment.IsGowerProcu = false; } if (ddl_isshare.SelectedIndex == 0) { Equipment.IsShare = true; } else { Equipment.IsShare = false; } Equipment.Price = tb_price.Text.Trim(); Equipment.Purchase = tb_Purchase.Text.Trim(); Equipment.PurchaseTime = dp_PurchaseTime.SelectedDate; Equipment.UsePerson = tb_UsePerson.Text.Trim(); Equipment.EquipNum = tb_Equipnum.Text.Trim(); string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName; Equipment.EntryPerson = username; Equipment.SecrecyLevel = Convert.ToInt32(DropDownListSecrecyLevel.SelectedIndex + 1); //Equipment.AgencyID = agency.SelectAgencyID(ddl_agencyname.SelectedText.Trim()); //Equipment.AgencName = tb_Agency.Text.Trim(); Equipment.AgencName = ddl_Agency.SelectedText; Equipment.CategoryName = "无"; Equipment.CategoryName = ddl_Category.SelectedText; Equipment.ClassNum = tb_ClassNum.Text.Trim(); Equipment.Manufacturer = tb_Manufacturer.Text.Trim(); Equipment.MeasurementUnit = tb_MeasurementUnit.Text.Trim(); Equipment.Model = tb_Model.Text.Trim(); Equipment.Remarks = tb_Remarks.Text.Trim(); Equipment.StorageLocation = tb_StorageLocation.Text.Trim(); if (Convert.ToInt32(Session["SecrecyLevel"]) < 5) { log.LoginName = username; log.OperationTime = DateTime.Now; log.LoginIP = " "; log.OperationContent = "Equipments"; log.OperationType = "更新"; Equipment.IsPass = false; blequip.Insert(Equipment);//插入设备表 log.OperationDataID = Convert.ToInt32(Session["EquipmentID"]); log.Remark = Convert.ToString(Equipment.EquipmentID); op.Insert(log); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待审核!")); } else { Equipment.IsPass = true; Equipment.EquipmentID = Convert.ToInt32(Session["EquipmentID"]); blequip.Update(Equipment);//更新设备表 PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功")); } } catch (Exception ex) { Alert.ShowInTop("保存出错,请联系管理员!"); pm.SaveError(ex, this.Request); } }