protected void imgbtn_SaveNext_Click(object sender, ImageClickEventArgs e) { string ls_gzjj = ftb_gzjj.Text.Replace("'", "’"); if (CommFun.StringCounter(ftb_gzjj.HtmlStrippedText) > 800) { Response.Write("<script>alert('业务工作简介限800字!');</script>"); return; } Save(); //Response.Redirect("zgsb_3.aspx?flag=" + hdn_flag.Value); Response.Redirect("yjysb-1.aspx?tablename=Table3&flag=" + hdn_flag.Value); }
protected void btn_commit_Click(object sender, EventArgs e) { string str_sql = "select count(*) from zjry where flag = 1 and zj_sfzh='" + Session["admin_id"].ToString() + "' and cpry_sfzh='" + lbl_cpry_sfzh.Text + "'"; string ls_content = ftb_content.Text.Replace("'", "’"); int i_count = CommFun.StringCounter(ftb_content.HtmlStrippedText); if (i_count > 180 || i_count < 50) { Response.Write("<script>alert('内容应在50~150字之间!');</script>"); return; } //if (ls_content == null || ls_content == "") //{ // Response.Write("<script>alert('推荐或不推荐理由不能为空!');</script>"); // return; //} if (DBFun.ExecuteScalar(str_sql).ToString() == "1") { str_sql = string.Format("update zjry set fs_pjys1 = '{0}',fs_pjys2 = '{1}',fs_pjys3 = '{2}',fs_pjys4 = '{3}'," + " fs_pjys5 = '{4}',fs_pjys6 = '{5}',fs_pjys_sum = '{6}',fs_sftj = '{7}',jypj = '{8}',psrq = '{9}'" + " where flag = 1 and zj_sfzh='{10}' and cpry_sfzh='{11}'", rbtnlist_1.SelectedValue, rbtnlist_2.SelectedValue, rbtnlist_3.SelectedValue, rbtnlist_4.SelectedValue, rbtnlist_5.SelectedValue, rbtnlist_6.SelectedValue, lbl_sum.Text, rbtnlist_tuijian.SelectedValue, ls_content, DateTime.Now.ToString("yyyy-MM-dd"), Session["admin_id"].ToString(), lbl_cpry_sfzh.Text); } else { str_sql = string.Format("insert into zjry (fs_pjys1,fs_pjys2,fs_pjys3,fs_pjys4,fs_pjys5,fs_pjys6," + " fs_pjys_sum,fs_sftj,jypj,psrq,zj_sfzh,cpry_sfzh,flag) " + " values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}',{12});", rbtnlist_1.SelectedValue, rbtnlist_2.SelectedValue, rbtnlist_3.SelectedValue, rbtnlist_4.SelectedValue, rbtnlist_5.SelectedValue, rbtnlist_6.SelectedValue, lbl_sum.Text, rbtnlist_tuijian.SelectedValue, ls_content, DateTime.Now.ToString("yyyy-MM-dd"), Session["admin_id"].ToString(), lbl_cpry_sfzh.Text, 1); } if (DBFun.ExecuteUpdate(str_sql)) { Response.Write("<script>alert('评分成功!');</script>"); } else { Response.Write("<script>alert('评分失败!');</script>"); } }
protected void Save() { string str_sql = ""; string ls_gzjj = ftb_gzjj.Text.Replace("'", "’"); if (CommFun.StringCounter(ftb_gzjj.HtmlStrippedText) > 800) { Response.Write("<script>alert('业务工作简介限800字!');</script>"); return; } CommFun.ReplaceZiHao(ref ls_gzjj, "10.5"); //string str_pra = UploadFile(FileUpload_photo, "photo", Session["sfzh"].ToString()); //if (str_pra == "") return; //if (str_pra == ",") // str_pra = img_photo.ImageUrl.Substring(img_photo.ImageUrl.LastIndexOf("/") + 1); //else // str_pra = str_pra.Substring(str_pra.LastIndexOf(",") + 1); str_sql = string.Format("update cpry set yourname = '{0}',birth = '{1}',xingbie = '{2}',zgxl_mc = '{3}',zgxl_bysj = '{4}'," + "zgxl_zy = '{5}',zgxl_sydw = '{6}',fhxl_mc = '{7}',fhxl_bysj = '{8}',fhxl_zy = '{9}',fhxl_sydw = '{10}'," + "fhxw_mc = '{11}',fhxw_qdsj = '{12}',fhxw_zy = '{13}',fhxw_sydw = '{14}',xrzw = '{15}',pdsj = '{16}',prsj = '{17}',gzjj='{18}' where sfzh = '{19}'", tbx2_xm.Text, tbx2_csny.Value, ddlist2_xb.SelectedValue, ddlist2_xl1.SelectedValue, tbx2_bysj1.Value, tbx2_zy1.Text, tbx2_sydw1.Text, ddlist2_xl2.SelectedValue, tbx2_bysj2.Value, tbx2_zy2.Text, tbx2_sydw2.Text, ddlist2_xw.SelectedValue, tbx2_qdsj.Value, tbx2_zy3.Text, tbx2_sydw3.Text, tbx2_xrzw.Text, tbx2_pdsj.Value, tbx2_prsj.Value, ftb_gzjj.HtmlStrippedText, Session["sfzh"].ToString()); if (DBFun.ExecuteUpdate(str_sql)) { Response.Write("<script>alert('保存成功!');</script>"); } else { Response.Write("<script>alert('保存失败!');</script>"); return; } bindData(); }
protected int Save() { string str_sql = ""; //lbl_id.Text = ""; if (Table1.Visible) { if (Convert.ToBoolean(ddlist_sfsb.SelectedValue)) { str_sql = "select jsm,num from t_teacher,(" + " select count(*) as num,jsh from t_cyqk where xm='" + Session["jsm"].ToString() + "' " + " group by jsh) as cy where t_teacher.jsh = cy.jsh "; DataTable dt = DBFun.dataTable(str_sql); if (dt.Rows.Count > 1) { string str_name = ""; for (int i = 0; i < dt.Rows.Count; i++) { str_name += " [ " + dt.Rows[i]["jsm"].ToString() + " ] "; } Response.Write("<script>alert('您已经参与了" + str_name + "的项目,不能再申请项目了!');</script>"); return(-1); } } str_sql = " update t_teacher set " + " status_sb=" + ddlist_sfsb.SelectedValue + "," + " xmlb='" + ddlist_lb.SelectedValue + "'," + " ktmc='" + tbx_xmmc.Text + "'," + " lxdh='" + tbx_lxdh.Text + "'," + " sqrq='" + txt_sqrq.Value + "'," + " sqbm='" + ddlist_sqbm.SelectedValue + "', " + " csny='" + txt_csny.Value + "', " + " xb='" + ddlist_xb.SelectedValue + "', " + " mz='" + ddlist_mz.SelectedValue + "', " + " zc='" + ddlist_zc.SelectedValue + "', " + " zw='" + ddlist_zw.SelectedValue + "', " + " gznx='" + ddlist_gznx.SelectedValue + "', " + " yjzc='" + tbx_yjzc.Text + "'," + " xl='" + ddlist_xl.SelectedValue + "', " + " xw='" + ddlist_xw.SelectedValue + "', " + " email='" + tbx_email.Text + "', " + " yjnx=" + ddlist_yjnx.SelectedValue + ", " + " xmjf_tsje=" + tbx_tsje.Text + ", " + " xmjf_tsyj='" + tbx_tsyj.Text + "', " + " xmjf_dyje=" + tbx_dyje.Text + ", " + " xmjf_dyyj='" + tbx_dyyj.Text + "', " + " xmjf_wyje=" + tbx_wyje.Text + ", " + " xmjf_wyyj='" + tbx_wyyj.Text + "', " + " xmjf_hyje=" + tbx_hyje.Text + ", " + " xmjf_hyyj='" + tbx_hyyj.Text + "', " + " xmjf_bmje=" + tbx_bmje.Text + ", " + " xmjf_bmyj='" + tbx_bmyj.Text + "', " + " xmjf_qtje=" + tbx_qtje.Text + ", " + " xmjf_qtyj='" + tbx_qtyj.Text + "' " + " where jsh = '" + Session["jsh"].ToString() + "'"; } else if (Table2.Visible) { //string ls_content = tbx2_1.Text; //string ls_content = ftb2_1.HtmlStrippedText; if (CommFun.StringCounter(tbx2_1.Text) > 1500) { Response.Write("<script>alert('选题应在1500字以内!');</script>"); return(-1); } if (CommFun.StringCounter(tbx2_2.Text) > 1500) { Response.Write("<script>alert('内容应在1500字以内!');</script>"); return(-1); } if (CommFun.StringCounter(tbx2_3.Text) > 800) { Response.Write("<script>alert('预期价值应在800字以内!');</script>"); return(-1); } str_sql = " update t_teacher set bg_1='" + tbx2_1.Text + "' , bg_2 = '" + tbx2_2.Text + "' , bg_3 = '" + tbx2_3.Text + "' , bg_4 = '" + tbx2_4.Text + "'" + " where jsh = '" + Session["jsh"].ToString() + "'"; } else if (Table3.Visible) { //if (tbx3_hjxm.Text == "") return 0; if (lbl_id.Text == "") { str_sql = "select count(*) from t_ktqk where jsh = '" + Session["jsh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 3)) { Response.Write("<script>alert('最多只能增加 3 项!');</script>"); return(-1); } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from t_ktqk where jsh = '" + Session["jsh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into t_ktqk (id,xmmc,xmbh,xmjb,sfjt,zccy,jsh) " + " values({0},'{1}','{2}','{3}','{4}','{5}','{6}');", int_maxbm, tbx3_xmmc.Text, tbx3_xmbh.Text, tbx3_xmjb.Text, ddlist3_sfjt.SelectedValue, ddlist3_zccy.SelectedValue, Session["jsh"].ToString()); } else { str_sql = string.Format("update t_ktqk set xmmc='{0}',xmbh='{1}',xmjb='{2}',sfjt='{3}',zccy='{4}' where jsh='{5}' and id={6} ", tbx3_xmmc.Text, tbx3_xmbh.Text, tbx3_xmjb.Text, ddlist3_sfjt.SelectedValue, ddlist3_zccy.SelectedValue, Session["jsh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table4.Visible) { //if (Convert.ToInt16(ddlist4_zrs.SelectedValue) < Convert.ToInt16(ddlist4_brpm.SelectedValue)) //{ // Response.Write("<script>alert('本人排名应小于等于总人数!');</script>"); // return -1; //} if (lbl_id.Text == "") { str_sql = "select count(*) from t_kycg where jsh = '" + Session["jsh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 3)) { Response.Write("<script>alert('最多只能增加 3 项!');</script>"); return(-1); } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from t_kycg where jsh = '" + Session["jsh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into t_kycg (id,lwmc,fbbk,brpm,jsh,zrs) " + " values({0},'{1}','{2}','{3}','{4}','{5}');", int_maxbm, tbx4_lwmc.Text, tbx4_fbbk.Text, ddlist4_brpm.SelectedValue, Session["jsh"].ToString(), ddlist4_zrs.SelectedValue); } else { str_sql = string.Format("update t_kycg set lwmc='{0}',fbbk='{1}',brpm='{2}',zrs='{5}' where jsh='{3}' and id={4} ", tbx4_lwmc.Text, tbx4_fbbk.Text, ddlist4_brpm.SelectedValue, Session["jsh"].ToString(), Convert.ToInt16(lbl_id.Text), ddlist4_zrs.SelectedValue); } } else if (Table5.Visible) { if (lbl_id.Text == "") { str_sql = "select count(*) from t_cyqk where jsh = '" + Session["jsh"].ToString() + "' and xm ='" + tbx5_xm.Text.Trim() + "'"; if (CommFun.JudgeRowCount(str_sql, 1)) { Response.Write("<script>alert('" + tbx5_xm.Text.Trim() + " 已经是该项目成员!');</script>"); return(-1); } //str_sql = "select status_sb from t_teacher where jsm = '" + tbx5_xm.Text.Trim() + "'"; //if (Convert.ToBoolean(DBFun.ExecuteScalar(str_sql))) //{ // str_sql = "select count(*) from t_cyqk where xm = '" + tbx5_xm.Text.Trim() + "'"; // if (CommFun.JudgeRowCount(str_sql, 1)) // { // Response.Write("<script>alert('" + tbx5_xm.Text.Trim() + " 已经参与了 2 个项目,不能再参与项目了!');</script>"); // return -1; // } //} //str_sql = "select count(*) from t_cyqk where xm = '" + tbx5_xm.Text.Trim() + "'"; //if (CommFun.JudgeRowCount(str_sql, 2)) //{ // Response.Write("<script>alert('" + tbx5_xm.Text.Trim() + " 已经参与了 2 个项目,不能再参与项目了!');</script>"); // return -1; //} str_sql = "select count(*) from q_tj_list where xm= '" + tbx5_xm.Text.Trim() + "'"; if (CommFun.JudgeRowCount(str_sql, 2)) { Response.Write("<script>alert('" + tbx5_xm.Text.Trim() + " 已经参与了 2 个项目,不能再参与项目了!');</script>"); return(-1); } str_sql = "select count(*) from t_cyqk where jsh = '" + Session["jsh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 5)) { Response.Write("<script>alert('最多只能增加 5 项!');</script>"); return(-1); } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from t_cyqk where jsh = '" + Session["jsh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into t_cyqk (id,xm,zc,szbm,yjzc,fg,jsh) " + " values({0},'{1}','{2}','{3}','{4}','{5}','{6}');", int_maxbm, tbx5_xm.Text, tbx5_zc.Text, ddlist5_szbm.SelectedValue, tbx5_yjzc.Text, tbx5_fg.Text, Session["jsh"].ToString()); } else { str_sql = string.Format("update t_cyqk set xm='{0}',zc='{1}',szbm='{2}',yjzc='{3}',fg='{4}' where jsh='{5}' and id={6} ", tbx5_xm.Text, tbx5_zc.Text, ddlist5_szbm.SelectedValue, tbx5_yjzc.Text, tbx5_fg.Text, Session["jsh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table6.Visible) { if (lbl_id.Text == "") { str_sql = "select count(*) from t_tjyj where jsh = '" + Session["jsh"].ToString() + "' and xm ='" + tbx6_xm.Text.Trim() + "'"; if (CommFun.JudgeRowCount(str_sql, 1)) { Response.Write("<script>alert('" + tbx6_xm.Text.Trim() + " 已经是推荐人,请选择其他人员!');</script>"); return(-1); } str_sql = "select count(*) from t_tjyj where jsh = '" + Session["jsh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 2)) { Response.Write("<script>alert('最多只能增加 2 位推荐人!');</script>"); return(-1); } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from t_tjyj where jsh = '" + Session["jsh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into t_tjyj (id,xm,zc,szbm,tjyj,jsh) " + " values({0},'{1}','{2}','{3}','{4}','{5}');", int_maxbm, tbx6_xm.Text, tbx6_zc.Text, ddlist6_szbm.SelectedValue, tbx6_tjyj.Text, Session["jsh"].ToString()); } else { str_sql = string.Format("update t_tjtj set xm='{0}',zc='{1}',szbm='{2}',tjyj='{3}' where jsh='{4}' and id={5} ", tbx6_xm.Text, tbx6_zc.Text, ddlist6_szbm.SelectedValue, tbx6_tjyj.Text, Session["jsh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } if (DBFun.ExecuteUpdate(str_sql)) { if (Session["msg"].ToString() == "no") { Session["msg"] = "yes"; } else { if (Table3.Visible || Table4.Visible || Table5.Visible || Table6.Visible) { Response.Write("<script>alert('添加成功!');</script>"); } else { Response.Write("<script>alert('保存成功!');</script>"); } // Response.Write("<script>alert('保存成功,申报材料已填写完毕,如需修改请点击相应模块!');</script>"); } bindData(); return(1); } else { Response.Write("<script>alert('保存失败!');</script>"); return(-1); } }
protected int Save() { string str_sql = ""; //lbl_id.Text = ""; if (Table1.Visible) { //判断入学日期 论文答辩日期 获学位日期 关系 try { if (Convert.ToDateTime(txt_rxny.Value) > Convert.ToDateTime(txt_dbrq.Value)) { Response.Write("<script>alert('入学日期应早于论文答辩日期!');</script>"); txt_rxny.Focus(); return(0); } else if (Convert.ToDateTime(txt_dbrq.Value) > Convert.ToDateTime(txt_hxwrq.Value)) { Response.Write("<script>alert('论文答辩日期应早于获得学位日期!');</script>"); txt_dbrq.Focus(); return(0); } } catch { if (txt_rxny.Value == "") { Response.Write("<script>alert('入学日期 不能为空!');</script>"); txt_rxny.Focus(); } else if (txt_dbrq.Value == "") { Response.Write("<script>alert('论文答辩日期 不能为空!');</script>"); txt_dbrq.Focus(); } else if (txt_hxwrq.Value == "") { Response.Write("<script>alert('获得学位日期 不能为空!');</script>"); txt_hxwrq.Focus(); } return(0); } str_sql = " update yxxwlw_cpry set cplb='" + rblist_cplb.SelectedValue + "'," + " yourname='" + tbx_Name.Text + "'," + " birth='" + txt_csny.Value + "'," + " xingbie='" + ddlist_xb.SelectedValue + "'," + " mz='" + ddlist_mz.SelectedValue + "', " + //" tjdw='" + ddlist_tjdw.SelectedValue + "', " + //" tjdw_mc='" + ddlist_tjdw.SelectedItem.Text + "', " + " rxny='" + txt_rxny.Value + "', " + " lwdbrq='" + txt_dbrq.Value + "', " + " xwhdrq='" + txt_hxwrq.Value + "', " + " yjxk_dm='" + ddlist_yjxkdm.SelectedValue + "'," + " yjxk_mc='" + ddlist_yjxkdm.SelectedItem.Text + "', " + " ejxk_dm='" + ddlist_ejxkdm.SelectedValue + "'," + " ejxk_mc='" + ddlist_ejxkdm.SelectedItem.Text + "', " + " sfzsxkzy=" + cbx_zsxkzy.Checked + ", " + " zsxkzy='" + tbx_zsxkzy.Text + "', " + " lw_ctitle='" + tbx_ctitle.Text + "', " + " lw_etitle='" + tbx_etitle.Text + "', " + " lw_yjfx='" + tbx_yjfx.Text + "'," + " gdxwfs='" + ddlist_gdxwfs.SelectedValue + "'," + " edit_rq='" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "' " + " where sfzh = '" + Session["sfzh"].ToString() + "'"; } else if (Table2.Visible) { if (tbx2_gzjl.Text == "") { return(0); } if (lbl_id.Text == "") { try { if (Convert.ToDateTime(Txt2_1.Value) > Convert.ToDateTime(Txt2_2.Value)) { Response.Write("<script>alert('开始时间应早于结束时间!');</script>"); Txt2_2.Focus(); return(0); } } catch { Response.Write("<script>alert('起止时间不能为空!');</script>"); Txt2_1.Focus(); return(0); } tbx2_qzsj.Text = Txt2_1.Value + "~" + Txt2_2.Value; str_sql = "select count(*) from yxxwlw_ll where sfzh = '" + Session["sfzh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 5)) { Response.Write("<script>alert('最多只能增加 5 项!');</script>"); return(-1); } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from yxxwlw_ll where sfzh = '" + Session["sfzh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into yxxwlw_ll (id,qzsj,jl,edit_rq,sfzh) " + " values({0},'{1}','{2}','{3}','{4}');", int_maxbm, tbx2_qzsj.Text, tbx2_gzjl.Text, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), Session["sfzh"].ToString()); } else { str_sql = string.Format("update yxxwlw_ll set qzsj='{0}',jl='{1}',edit_rq='{2}' where sfzh='{3}' and id={4} ", tbx2_qzsj.Text, tbx2_gzjl.Text, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), Session["sfzh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table3.Visible) { string ls_content1 = ftb3_1.Text.Replace("'", "’"); string ls_content2 = ftb3_2.Text.Replace("'", "’"); string ls_content3 = ftb3_3.Text.Replace("'", "’"); if (CommFun.StringCounter(ftb3_1.HtmlStrippedText) > 3000) { Response.Write("<script>alert('论文中文摘要 内容应在3000字以内!');</script>"); return(-1); } if (CommFun.StringCounter(ftb3_2.HtmlStrippedText) > 6000) { Response.Write("<script>alert('论文英文摘要 内容应在6000字以内!');</script>"); return(-1); } if (CommFun.StringCounter(ftb3_3.HtmlStrippedText) > 400) { Response.Write("<script>alert('学位论文的主要创新点 内容应在400字以内!');</script>"); return(-1); } str_sql = " update yxxwlw_cpry set lw_Cabstract='" + ls_content1 + "', " + " lw_Eabstract = '" + ls_content2 + "', " + " lw_cxd = '" + ls_content3 + "' " + " where sfzh = '" + Session["sfzh"].ToString() + "'"; } else if (Table4.Visible) { if (tbx4_tm.Text == "") { return(0); } if (lbl_id.Text == "") { str_sql = "select count(*) from yxxwlw_lw where sfzh = '" + Session["sfzh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 5)) { Response.Write("<script>alert('最多只能增加 5 项!');</script>"); return(-1); } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from yxxwlw_lw where sfzh = '" + Session["sfzh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into yxxwlw_lw (id,tm,kwmc,kwqh,fbsj,pm,slqk,edit_rq,sfzh) " + " values({0},'{1}','{2}','{3}','{4}',{5},'{6}','{7}','{8}');", int_maxbm, tbx4_tm.Text, tbx4_kwmc.Text, tbx4_kwqh.Text, txt4_fbsj.Value, tbx4_pm.Text, ddlist4_slqk.SelectedValue, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), Session["sfzh"].ToString()); } else { str_sql = string.Format("update yxxwlw_lw set tm='{0}',kwmc='{1}',kwqh='{2}',fbsj='{3}',pm='{4}',slqk='{5}',edit_rq = '{6}' where sfzh='{7}' and id={8} ", tbx4_tm.Text, tbx4_kwmc.Text, tbx4_kwqh.Text, txt4_fbsj.Value, tbx4_pm.Text, ddlist4_slqk.SelectedValue, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), Session["sfzh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table5.Visible) { if (tbx5_zzmc.Text == "") { return(0); } if (lbl_id.Text == "") { str_sql = "select count(*) from yxxwlw_zz where sfzh = '" + Session["sfzh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 3)) { Response.Write("<script>alert('最多只能增加 3 项!');</script>"); return(-1); } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from yxxwlw_zz where sfzh = '" + Session["sfzh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into yxxwlw_zz (id,zzmc,cbs,cbsj,pm,edit_rq,sfzh) " + " values({0},'{1}','{2}','{3}','{4}','{5}','{6}');", int_maxbm, tbx5_zzmc.Text, tbx5_cbs.Text, txt5_cbsj.Value, tbx5_pm.Text, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), Session["sfzh"].ToString()); } else { str_sql = string.Format("update yxxwlw_zz set zzmc='{0}',cbs='{1}',cbsj='{2}',pm={3},edit_rq='{4}' where sfzh='{5}' and id={6} ", tbx5_zzmc.Text, tbx5_cbs.Text, txt5_cbsj.Value, tbx5_pm.Text, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), Session["sfzh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table6.Visible) { if (tbx6_cgmc.Text == "") { return(0); } if (lbl_id.Text == "") { str_sql = "select count(*) from yxxwlw_cg where sfzh = '" + Session["sfzh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 3)) { Response.Write("<script>alert('最多只能增加 3 项!');</script>"); return(-1); } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from yxxwlw_cg where sfzh = '" + Session["sfzh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into yxxwlw_cg (id,cgmc,jlmc,hjdj,hjsj,pm,edit_rq,sfzh) " + " values({0},'{1}','{2}','{3}','{4}',{5},'{6}','{7}');", int_maxbm, tbx6_cgmc.Text, tbx6_jlmc.Text, ddlist6_jldj.SelectedValue, txt6_hjsj.Value, tbx6_pm.Text, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), Session["sfzh"].ToString()); } else { str_sql = string.Format("update yxxwlw_cg set cgmc='{0}',jlmc='{1}',hjdj='{2}',hjsj='{3}',pm={4},edit_rq='{5}' where sfzh='{6}' and id={7} ", tbx6_cgmc.Text, tbx6_jlmc.Text, ddlist6_jldj.SelectedValue, txt6_hjsj.Value, tbx6_pm.Text, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), Session["sfzh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table7.Visible) { //判断首任博导时间与首任硕导时间关系 try { if (Convert.ToDateTime(Txt7_zdjs_srsdny.Value) > Convert.ToDateTime(Txt7_zdjs_srbdny.Value)) { Response.Write("<script>alert('首任硕导年月应早于首任博导年月!');</script>"); Txt7_zdjs_srsdny.Focus(); return(0); } } catch { //if (Txt7_zdjs_srsdny.Value == "") //{ // Response.Write("<script>alert('首任硕导年月不能为空!');</script>"); // Txt7_zdjs_srsdny.Focus(); // return 0; //} } if (tbx7_zdjs_xzrs.Text == "") { tbx7_zdjs_xzrs.Text = "0"; } if (tbx7_zdjs_zdss.Text == "") { tbx7_zdjs_zdss.Text = "0"; } if (tbx7_zdjs_zdbs.Text == "") { tbx7_zdjs_zdbs.Text = "0"; } if (tbx7_zdjs_byss.Text == "") { tbx7_zdjs_byss.Text = "0"; } if (tbx7_zdjs_bybs.Text == "") { tbx7_zdjs_bybs.Text = "0"; } str_sql = " update yxxwlw_cpry set zdjs_xm='" + tbx7_zdjs_xm.Text + "'," + " zdjs_csny='" + txt7_zdjs_csny.Value + "'," + " zdjs_xingbie='" + ddlist7_zdjs_xingbie.SelectedValue + "'," + " zdjs_zzxl='" + ddlist7_zdjs_zzxl.SelectedValue + "'," + " zdjs_zgxw='" + ddlist7_zdjs_zgxw.SelectedValue + "', " + " zdjs_sfys=" + ddlist7_zdjs_sfys.SelectedValue + ", " + " zdjs_srbdny='" + Txt7_zdjs_srbdny.Value + "', " + " zdjs_srsdny='" + Txt7_zdjs_srsdny.Value + "', " + " zdjs_yjfx='" + tbx7_zdjs_yjfx.Text + "', " + " zdjs_dsdh='" + tbx7_zdjs_dsdh.Text + "'," + " zdjs_dsyx='" + tbx7_zdjs_dsyx.Text + "', " + " zdjs_xzrs=" + Convert.ToInt16(tbx7_zdjs_xzrs.Text) + ", " + " zdjs_zdss=" + Convert.ToInt16(tbx7_zdjs_zdss.Text) + ", " + " zdjs_zdbs=" + Convert.ToInt16(tbx7_zdjs_zdbs.Text) + ", " + " zdjs_byss=" + Convert.ToInt16(tbx7_zdjs_byss.Text) + ", " + " zdjs_bybs=" + Convert.ToInt16(tbx7_zdjs_bybs.Text) + ", " + " jzbd_gzdw='" + tbx7_jzbd_gzdw.Text + "'," + " xrzw='" + tbx7_xrzw.Text + "'," + " edit_rq='" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "' " + " where sfzh = '" + Session["sfzh"].ToString() + "'"; } if (DBFun.ExecuteUpdate(str_sql)) { if (Session["msg"].ToString() == "no") { Session["msg"] = "yes"; } else { if (Table3.Visible || Table5.Visible) { Response.Write("<script>alert('添加成功!');</script>"); } else { Response.Write("<script>alert('保存成功!');</script>"); } // Response.Write("<script>alert('保存成功,申报材料已填写完毕,如需修改请点击相应模块!');</script>"); } bindData(); return(1); } else { Response.Write("<script>alert('保存失败!');</script>"); return(-1); } }
protected int Save() { string str_sql = ""; //lbl_id.Text = ""; if (Table1.Visible) { str_sql = " update ts_cpry set dept='" + tbx_bm.Text + "'," + " leibie='" + ddlist_lb.SelectedValue + "'," + //" zjdm='" + tbx_zjdm.Text + "'," + //" zjbs='" + tbx_zjbs.Text + "'," + " yourname='" + tbx_Name.Text + "'," + " birth='" + txt_csrq.Value + "'," + " xingbie='" + ddlist_xb.SelectedValue + "'," + " csd='" + tbx_csd.Text + "', " + " zzmm='" + ddlist_zzmm.SelectedValue + "', " + " mz='" + ddlist_mz.SelectedValue + "', " + " whcd='" + ddlist_whcd.SelectedValue + "', " + " xw='" + ddlist_xw.SelectedValue + "', " + " bysj='" + txt_bysj.Value + "'," + " byxx='" + tbx_byxx.Text + "', " + " sxzy='" + tbx_sxzy.Text + "', " + " cszy='" + tbx_cszy.Text + "', " + " jszc='" + ddlist_jszc.SelectedValue + "', " + " gzdw_mc='" + tbx_gzdw.Text + "'," + " gzsj='" + txt_gzsj.Value + "'," + " dwlb='" + ddlist_dwlb.SelectedValue + "', " + " dwxz='" + ddlist_dwxz.SelectedValue + "', " + " zgzt='" + ddlist_zgzt.SelectedValue + "', " + " xzzw='" + ddlist_xzzw.SelectedValue + "', " + " xzjb='" + ddlist_xzjb.SelectedValue + "', " + " ggqjb='" + ddlist_ggqjb.SelectedValue + "', " + " gkhy='" + ddlist_gkhy.SelectedValue + "', " + " lxdh='" + tbx_lxdh.Text + "'," + " yzbm='" + tbx_yzbm.Text + "'," + " ys='" + ddlist_ys.SelectedValue + "', " + " gzbj='" + tbx_gzbj.Text + "'," + " ttnf='" + ddlist_ttnf.SelectedValue + "', " + " ttje='" + tbx_ttje.Text + "'," + " tgnf='" + ddlist_tgnf.SelectedValue + "', " + " sbnf='" + ddlist_sbnf.SelectedValue + "', " + " hgnf='" + ddlist_hgnf.SelectedValue + "', " + " hcgl='" + tbx_hcgl.Text + "'," + " lhjt='" + tbx_lhjt.Text + "'," + " bdnf='" + ddlist_bdnf.SelectedValue + "', " + " jbzn='" + ddlist_jbzn.SelectedValue + "' " + " where sfzh = '" + Session["sfzh"].ToString() + "'"; } else if (Table2.Visible) { string ls_content = ftb2_1.Text.Replace("'", "’"); if (CommFun.StringCounter(ftb2_1.HtmlStrippedText) > 600) { Response.Write("<script>alert('内容应在600字以内!');</script>"); return(-1); } str_sql = " update ts_cpry set gzjl='" + ls_content + "' " + " where sfzh = '" + Session["sfzh"].ToString() + "'"; } else if (Table3.Visible) { if (tbx3_hjxm.Text == "") { return(0); } if (lbl_id.Text == "") { str_sql = "select count(*) from ts_hjqk where sfzh = '" + Session["sfzh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 12)) { Response.Write("<script>alert('最多只能增加 12 项!');</script>"); return(-1); } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from ts_hjqk where sfzh = '" + Session["sfzh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into ts_hjqk (id,jlzl,hjxm,jldj,pm,nd,sfzh) " + " values({0},'{1}','{2}','{3}','{4}','{5}','{6}');", int_maxbm, ddlist3_jlzl.SelectedValue, tbx3_hjxm.Text, ddlist3_jldj.SelectedValue, tbx3_pm.Text, ddlist3_nd.SelectedValue, Session["sfzh"].ToString()); } else { str_sql = string.Format("update ts_hjqk set jlzl='{0}',hjxm='{1}',jldj='{2}',pm='{3}',nd='{4}' where sfzh='{5}' and id={6} ", ddlist3_jlzl.SelectedValue, tbx3_hjxm.Text, ddlist3_jldj.SelectedValue, tbx3_pm.Text, ddlist3_nd.SelectedValue, Session["sfzh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table4.Visible) { string ls_content1 = ftb4_1.Text.Replace("'", "’"); string ls_content2 = ftb4_2.Text.Replace("'", "’"); string ls_content3 = ftb4_3.Text.Replace("'", "’"); if (CommFun.StringCounter(ftb4_1.HtmlStrippedText) > 150) { Response.Write("<script>alert('主要突出贡献事迹 内容应在150字以内!');</script>"); return(-1); } if (CommFun.StringCounter(ftb4_2.HtmlStrippedText) > 600) { Response.Write("<script>alert('代表论文和著作 内容应在600字以内!');</script>"); return(-1); } if (CommFun.StringCounter(ftb4_3.HtmlStrippedText) > 600) { Response.Write("<script>alert('最新成果 内容应在600字以内!');</script>"); return(-1); } str_sql = " update ts_cpry set gxsj='" + ls_content1 + "'," + " lwzz='" + ls_content2 + "'," + " zxcg='" + ls_content3 + "' " + " where sfzh = '" + Session["sfzh"].ToString() + "'"; } else if (Table5.Visible) { if (tbx5_khnr.Text == "") { return(0); } if (lbl_id.Text == "") { str_sql = "select count(*) from ts_khqk where sfzh = '" + Session["sfzh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 8)) { Response.Write("<script>alert('最多只能增加 8 项!');</script>"); return(-1); } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from ts_khqk where sfzh = '" + Session["sfzh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into ts_khqk (id,khnd,khnr,khjl,sfzh) " + " values({0},'{1}','{2}','{3}','{4}');", int_maxbm, ddlist5_khnd.SelectedValue, tbx5_khnr.Text, ddlist5_khjl.SelectedValue, Session["sfzh"].ToString()); } else { str_sql = string.Format("update ts_khqk set khnd='{0}',khnr='{1}',khjl='{2}' where sfzh='{3}' and id={4} ", ddlist5_khnd.SelectedValue, tbx5_khnr.Text, ddlist5_khjl.SelectedValue, Session["sfzh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } if (DBFun.ExecuteUpdate(str_sql)) { if (!Table5.Visible) { Response.Write("<script>alert('保存成功!');</script>"); } else { Response.Write("<script>alert('保存成功,申报材料已填写完毕,如需修改请点击相应模块!');</script>"); } bindData(); return(1); } else { Response.Write("<script>alert('保存失败!');</script>"); return(-1); } }
protected void Save() { string str_sql = ""; //lbl_id.Text = ""; if (Table1.Visible) { if (CommFun.StringCounter(tbx_gzjj.Text) > 600) { Response.Write("<script>alert('主要工作业绩限600字!');</script>"); return; } if (!tbx_xkfx.Visible) { tbx_xkfx.Text = ddl_xkfx.SelectedItem.Text; } str_sql = string.Format(" update ej_cpry set yourname='{0}',birth='{1}',xingbie='{2}',zgxl='{3}',zgxw='{4}'," + " xrgw='{5}',zgsj='{6}',prsj='{7}',gwxl='{8}'," + " dw='{9}',xkfx='{10}',xkfx_qt='{11}',gzjj='{13}' where sfzh = '{12}' ;", tbx_Name.Text, txt_csny.Value, ddl_xb.SelectedValue, ddl_xl.SelectedValue, ddl_xw.SelectedValue, ddl_xrgw.SelectedValue, txt_zgsj.Value, txt_prsj.Value, ddl_gwxl.SelectedValue, ddl_dw.SelectedValue, ddl_xkfx.SelectedValue, tbx_xkfx.Text, Session["sfzh"].ToString(), tbx_gzjj.Text); } else if (Table2.Visible) { if (tbx2_xmmc.Text == "") { return; } tbx2_qzsj.Text = txt2_1.Value + "~" + txt2_2.Value; if (CommFun.StringCounter(tbx2_xmlb.Text) > 14) { Response.Write("<script>alert('项目类别限14字!');</script>"); return; } if (lbl_id.Text == "") { str_sql = "select count(*) from ej_cdxmqk where sfzh = '" + Session["sfzh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 5)) { Response.Write("<script>alert('最多只能增加5项!');</script>"); return; } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from ej_cdxmqk where sfzh = '" + Session["sfzh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); if (tbx2_xmjf.Text == "") { tbx2_xmjf.Text = "0"; } str_sql = string.Format("insert into ej_cdxmqk (id,xmmc,xmlb,xmjf,brjs,qzsj,sfzh) " + " values({0},'{1}','{2}','{3}','{4}','{5}','{6}');", int_maxbm, tbx2_xmmc.Text, tbx2_xmlb.Text, tbx2_xmjf.Text, ddl2_brjs.SelectedValue, tbx2_qzsj.Text, Session["sfzh"].ToString()); } else { str_sql = string.Format("update ej_cdxmqk set xmmc='{0}',xmlb='{1}',xmjf='{2}',brjs='{3}',qzsj='{4}' where sfzh='{5}' and id={6} ", tbx2_xmmc.Text, tbx2_xmlb.Text, tbx2_xmjf.Text, ddl2_brjs.SelectedValue, tbx2_qzsj.Text, Session["sfzh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table3.Visible) { if (tbx3_tm.Text == "") { return; } if (lbl_id.Text == "") { str_sql = "select count(*) from ej_dbxlz where sfzh = '" + Session["sfzh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 5)) { Response.Write("<script>alert('最多只能增加5项!');</script>"); return; } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from ej_dbxlz where sfzh = '" + Session["sfzh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into ej_dbxlz (id,tm,fbsj,kwmc,brpm,sfzh) " + " values({0},'{1}','{2}','{3}','{4}','{5}');", int_maxbm, tbx3_tm.Text, txt3.Value, tbx3_kwmc.Text, tbx3_brpm.Text, Session["sfzh"].ToString()); } else { str_sql = string.Format("update ej_dbxlz set tm='{0}',fbsj='{1}',kwmc='{2}',brpm='{3}' where sfzh='{4}' and id={5} ", tbx3_tm.Text, txt3.Value, tbx3_kwmc.Text, tbx3_brpm.Text, Session["sfzh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table4.Visible) { if (tbx4_zlmc.Text == "") { return; } if (lbl_id.Text == "") { str_sql = "select count(*) from ej_zlycgzh where sfzh = '" + Session["sfzh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 5)) { Response.Write("<script>alert('最多只能增加5项!');</script>"); return; } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from ej_zlycgzh where sfzh = '" + Session["sfzh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into ej_zlycgzh (id,zlmc,zhjg,sfzh) " + " values({0},'{1}','{2}','{3}');", int_maxbm, tbx4_zlmc.Text, tbx4_zhjg.Text, Session["sfzh"].ToString()); } else { str_sql = string.Format("update ej_zlycgzh set zlmc='{0}',zhjg='{1}' where sfzh='{2}' and id={3} ", tbx4_zlmc.Text, tbx4_zhjg.Text, Session["sfzh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table5.Visible) { if (tbx5_hjcgmc.Text == "") { return; } if (lbl_id.Text == "") { str_sql = "select count(*) from ej_hjqk where sfzh = '" + Session["sfzh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 5)) { Response.Write("<script>alert('最多只能增加5项!');</script>"); return; } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from ej_hjqk where sfzh = '" + Session["sfzh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into ej_hjqk (id,nd,jlzl,hjcgmc,jldj,pm,sfzh) " + " values({0},'{1}','{2}','{3}','{4}','{5}','{6}');", int_maxbm, ddl5_nd.SelectedValue, ddl5_jlzl.SelectedValue, tbx5_hjcgmc.Text, ddl5_jldj.SelectedValue, tbx5_pm.Text, Session["sfzh"].ToString()); } else { str_sql = string.Format("update ej_hjqk set nd='{0}',jlzl='{1}',hjcgmc='{2}',jldj='{3}',pm='{4}' where sfzh='{5}' and id={6} ", ddl5_nd.SelectedValue, ddl5_jlzl.SelectedValue, tbx5_hjcgmc.Text, ddl5_jldj.SelectedValue, tbx5_pm.Text, Session["sfzh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table6.Visible) { if (tbx6_rzzzmc.Text == "") { return; } tbx6_qzsj.Text = txt6_1.Value + "~" + txt6_2.Value; if (lbl_id.Text == "") { str_sql = "select count(*) from ej_xsrzqk where sfzh = '" + Session["sfzh"].ToString() + "'"; if (CommFun.JudgeRowCount(str_sql, 5)) { Response.Write("<script>alert('最多只能增加5项!');</script>"); return; } str_sql = "select iif(isnull(max(id)),1,max(id)+1) as maxid from ej_xsrzqk where sfzh = '" + Session["sfzh"].ToString() + "'"; int int_maxbm = Convert.ToInt32(DBFun.ExecuteScalar(str_sql).ToString()); str_sql = string.Format("insert into ej_xsrzqk (id,rzzzmc,drzw,rzqzsj,sfzh) " + " values({0},'{1}','{2}','{3}','{4}');", int_maxbm, tbx6_rzzzmc.Text, tbx6_drzw.Text, tbx6_qzsj.Text, Session["sfzh"].ToString()); } else { str_sql = string.Format("update ej_xsrzqk set rzzzmc='{0}',drzw='{1}',rzqzsj='{2}' where sfzh='{3}' and id={4} ", tbx6_rzzzmc.Text, tbx6_drzw.Text, tbx6_qzsj.Text, Session["sfzh"].ToString(), Convert.ToInt16(lbl_id.Text)); } } else if (Table7.Visible) { str_sql = string.Format(" update ej_cpry set qtwt='{0}' where sfzh = '{1}' ;", tbx7_qtwt.Text, Session["sfzh"].ToString()); } if (DBFun.ExecuteUpdate(str_sql)) { if (!Table7.Visible) { Response.Write("<script>alert('保存成功!');</script>"); } else { Response.Write("<script>alert('保存成功,申报材料已填写完毕,如需修改请点击相应模块!');</script>"); } bindData(); } else { Response.Write("<script>alert('保存失败!');</script>"); } }