protected void Button3_Click(object sender, EventArgs e) { try { string name = tb_AssociationName.Text; string domicile = TextBox2.Text; string referee = TextBox4.Text; string contacts = tb_RegisteredFund.Text; string phoneNo = tb_ContactName.Text; string email = tb_Telephone.Text; string type = tb_Fax.Text; string investorOfTW = TextBox6.Text; string investorOfH = TextBox1.Text; string scope = TextBox9.Text; string product = TextBox10.Text; if (isNew == 0) //修改 { EnterpriseBusiness.UpdateEnterprise(id, name, domicile, referee, contacts, phoneNo, email, type, investorOfTW, investorOfH, scope, product); LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 4, "合作大学信息", log_ip, log_account);//修改添加日志 操作类型->4 } else { EnterpriseBusiness.AddEnterpriseForNew(id, name, domicile, referee, contacts, phoneNo, email, type, investorOfTW, investorOfH, scope, product); LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 2, "合作大学信息", log_ip, log_account);//新增添加日志 操作类型->2 } Response.Redirect("./CheckAffairList_tzqy.aspx"); } catch (Exception ex) { //Page.RegisterStartupScript("alert", "<script>alert('数据加载失败!')</script>"); Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('数据加载错误!')", true); text(ex.ToString()); } }
protected void gv_Result_RowCommand(object sender, GridViewCommandEventArgs e) { string command = e.CommandName; int id = Convert.ToInt32(e.CommandArgument); if (command.Equals("Chk"))//查看 { Response.Redirect("CheckAffairList_zxgz_Add.aspx?CommunicationId=" + id); } else if (command.Equals("Upd"))//修改 { Response.Redirect("CheckAffairList_zxgz_Add.aspx?CommunicationId=" + id); } else if (command.Equals("Del"))//删除 { bool result = SpecialWorkBusiness.DeleteCommunication(id); if (!result) { ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "alter", "alert('删除失败,请重新再试!')", true); return; } LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 3, "专项工作信息", log_ip, log_account);//删除添加日志 操作类型->3 RefreshView(0); } }
protected void gv_Result_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Del")) { string id = e.CommandArgument.ToString(); bool result = EnterpriseBusiness.deleteEnterprise(Int32.Parse(id)); if (!result) { ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "alter", "alert('删除失败,请重新再试!')", true); return; } LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 3, "台资企业信息", log_ip, log_account);//删除添加日志 操作类型->3 RefreshView(0); } }
private string Save() { try { //新增时判重,通过姓名,证件类型,证件号码进行唯一性判别别。 if (isNew == 1 && Student.FindOne(CK.K["Name"] == tb_AssociationName.Text && CK.K["IdentityNo"] == tb_OrganizationCode.Text && CK.K["IsDelete"] == false) != null) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('此人信息已存在,请勿重复添加!')", true); return("fail"); } string name = tb_AssociationName.Text; bool sex = !radio_1.SelectedValue.Equals("1"); String identityNo = tb_OrganizationCode.Text; DateTime birthday = input_RegisterDate.Value.Equals("") ? new DateTime(1900, 1, 1) : Convert.ToDateTime(input_RegisterDate.Value); String school = ddl_School.SelectedValue; int studyTypeId = Convert.ToInt32(ddl_StudyType.SelectedValue); DateTime joinSchoolDate = input_JoinSchoolDate.Value.Equals("") ? new DateTime(1900, 1, 1) : Convert.ToDateTime(input_JoinSchoolDate.Value); String major = tb_ContactName.Text; String systemOfEdu = tb_Telephone.Text; String phoneNo = tb_Fax.Text; String AddressOfH = tb_ScopeOfBusiness.Text; //String addressOfTW = "台湾省" + ddl_csmc.SelectedValue;//TextBox1.Text; String tip = TextBox3.Text; string result = ""; if (isNew == 0) //修改 { result = StudentBusiness.UpdateStudent(id, name, sex, identityNo, birthday, school, studyTypeId, joinSchoolDate, major, systemOfEdu, phoneNo, AddressOfH, tip); LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 4, "在校本科生信息", log_ip, log_account);//修改添加日志 操作类型->4 } else { result = StudentBusiness.AddStudentForNew(id, name, sex, identityNo, birthday, school, studyTypeId, joinSchoolDate, major, systemOfEdu, phoneNo, AddressOfH, tip); LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 2, "在校本科生信息", log_ip, log_account);//新增添加日志 操作类型->2 } return(result); } catch (Exception ex) { //Page.RegisterStartupScript("alert", "<script>alert('数据加载失败!')</script>"); Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('数据加载错误!')", true); text(ex.ToString()); return(""); } }
protected void Button3_Click(object sender, EventArgs e) { try { int communicationTypeId = Convert.ToInt32(ddl_CommunicationType.SelectedValue); string groupArea = tb_GroupArea.Text; string groupName = tb_GroupName.Text; string groupMonitor = tb_GroupMonitor.Text; string groupMembers = tb_GroupMembers.Value; string communicationGenerate = tb_CommunicationGenerate.Value; string communicationSummarize = tb_CommunicationSummarize.Value; string communicationReport = tb_CommunicationReport.Value; string communicationPhotos = tb_CommunicationPhotos.Value; if (communicationTypeId == 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('请选择交流形式!')", true); return; } if (id != 0) //修改 { GroupCommunicationWorkBusiness.UpdateGroupCommunication(id, communicationTypeId, groupArea, groupName, groupMonitor, groupMembers, communicationGenerate, communicationSummarize, communicationReport, communicationPhotos); LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 4, "团组交流工作信息", log_ip, log_account);//修改添加日志 操作类型->4 } else { GroupCommunicationWorkBusiness.AddGroupCommunication(communicationTypeId, groupArea, groupName, groupMonitor, groupMembers, communicationGenerate, communicationSummarize, communicationReport, communicationPhotos); LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 2, "团组交流工作信息", log_ip, log_account);//新增添加日志 操作类型->2 } Response.Redirect("./CheckAffairList_tzjlgz.aspx"); } catch (Exception ex) { //Page.RegisterStartupScript("alert", "<script>alert('数据加载失败!')</script>"); Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('数据加载错误!')", true); text(ex.ToString()); } }
protected void btn_submit_Click(object sender, EventArgs e) { try { //所有表单数据 string exchange = tb_Exchange.Text; string type = tb_Type.Text; string name = tb_Name.Text; bool sex = Radio_woman.Checked;//sex true女 false男 DateTime birth = new DateTime(1900, 1, 1); int specialWorkTypeId = Convert.ToInt32(ddl_SpecialWorkType.SelectedValue); DateTime workStartDate = new DateTime(1900, 1, 1); DateTime workEndDate = new DateTime(1900, 1, 1); if (specialWorkTypeId == 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('请选择类别!')", true); return; } try { birth = tb_birth.Value.Equals("") ? birth : Convert.ToDateTime(tb_birth.Value); workStartDate = tb_workStartDate.Value.Equals("") ? workStartDate : Convert.ToDateTime(tb_workStartDate.Value); workEndDate = tb_workEndDate.Value.Equals("") ? workEndDate : Convert.ToDateTime(tb_workEndDate.Value); } catch (Exception ex) { text(ex.ToString()); Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('日期输入格式不规范,请重新输入!')", true); return; } string company = tb_company.Text; string address = tb_address.Text; string phoneNo = tb_phoneNo.Text; double ballot = 0; try { ballot = tb_ballot.Text.ToString().IsNullOrEmpty() ? 0 : Convert.ToDouble(tb_ballot.Text); } catch (Exception ex) { text(ex.ToString()); Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('当选得票数率输入格式不规范,请重新输入!')", true); return; } bool isReselect = Radio_IsReselect_Yes.Checked; string background = tb_Background.Text; string situation = tb_Situation.Text; if (communicationId != 0) { bool result = false; if (IsNew == null)//修改 { result = SpecialWorkBusiness.UpdateCommunication(communicationId, exchange, specialWorkTypeId, workStartDate, workEndDate, type, name, sex, birth, company, address, phoneNo, ballot, isReselect, background, situation); LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 4, "专项工作信息", log_ip, log_account);//修改添加日志 操作类型->4 } else//新增 { result = SpecialWorkBusiness.UpdateCommunicationForNew(communicationId, exchange, specialWorkTypeId, workStartDate, workEndDate, type, name, sex, birth, company, address, phoneNo, ballot, isReselect, background, situation); LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 2, "专项工作信息", log_ip, log_account);//新增添加日志 操作类型->2 } if (!result) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('保存失败,请重新再试!')", true); return; } Response.Redirect("CheckAffairList_zxgz.aspx"); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('数据加载错误,请重新再试!')", true); return; } } catch (Exception ex) { text(ex.ToString()); Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('数据加载错误,请重新再试!')", true); } }
protected void Button3_Click(object sender, EventArgs e) { try { //新增时判重,通过姓名,证件类型,证件号码进行唯一性判别别。 if (isNew == 1 && People.FindOne(CK.K["Name"] == tb_AssociationName.Text && CK.K["IdentityNo"] == tb_RegisteredFund.Text && CK.K["IsDelete"] == false) != null) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('此人信息已存在,请勿重复添加!')", true); return; } string name = tb_AssociationName.Text; bool sex = !radio_1.SelectedValue.Equals("1"); DateTime arriveDate = new DateTime(1900, 1, 2); try { arriveDate = Text1.Value.Equals("") ? arriveDate : Convert.ToDateTime(Text1.Value); } catch (Exception ex) { text(ex.ToString()); Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('时间输入格式不规范,请重新输入!')", true); return; } DateTime birthday = new DateTime(1900, 1, 2); try { birthday = input_RegisterDate.Value.Equals("") ? birthday : Convert.ToDateTime(input_RegisterDate.Value); } catch (Exception ex) { text(ex.ToString()); Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('时间输入格式不规范,请重新输入!')", true); return; } String identityNo = tb_RegisteredFund.Text; String phoneNo = tb_ContactName.Text; DateTime validityOfTW = new DateTime(1900, 1, 2); String address = TextBox6.Text; String tempApplication = TextBox7.Text; int comeReason = int.Parse(ddl.SelectedValue); String tip = TextBox3.Text; if (isNew == 0) //修改 { PeopleBusiness.UpdatePeople(id, name, sex, arriveDate, birthday, identityNo, phoneNo, address, tempApplication, comeReason, tip); LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 4, "教职工信息", log_ip, log_account);//修改添加日志 操作类型->4 } else { string result = PeopleBusiness.AddPeopleForNew(id, name, sex, arriveDate, birthday, identityNo, phoneNo, address, tempApplication, comeReason, tip); LogInfoBusiness.AddLogInfo(Convert.ToInt32(log_userid), DateTime.Now, Convert.ToInt32(log_usertype), log_username, 2, "教职工信息", log_ip, log_account);//新增添加日志 操作类型->2 BusinessBusiness.AddBusinessNull(id); AgedBusiness.AddAgedNull(id); RelativeOfPeopleBusiness.AddRelativeNull(id); StudyBusiness.AddStudyNull(id); VisitBusiness.AddVisitNull(id); WorkBusiness.AddWorkNull(id); } Response.Redirect("./CheckAffairList_cztb.aspx"); } catch (Exception ex) { //Page.RegisterStartupScript("alert", "<script>alert('数据加载失败!')</script>"); Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('数据加载错误!')", true); text(ex.ToString()); } }