//执行 protected void Button_Zx_Click(object sender, EventArgs e) { string ls_return = ""; if (txtsql2.Value == "") { ls_return = "请填写执行语句"; } if (ddldbconn.SelectedValue == "") { ls_return = "请选择连接"; } HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (ddldbconn.SelectedValue == "base") { if (Hyoa_global.ExcuteSQL_BASE(txtsql2.Value) == true) ls_return = "执行成功"; else ls_return = "执行失败"; } if (ddldbconn.SelectedValue == "pro") { if (Hyoa_global.ExcuteSQL(txtsql2.Value) == true) ls_return = "执行成功"; else ls_return = "执行失败"; } if (ddldbconn.SelectedValue == "user") { if (Hyoa_global.ExcuteSQL_USER(txtsql2.Value) == true) ls_return = "执行成功"; else ls_return = "执行失败"; } lbljg.Text = ls_return; }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "设置成功,系统将自动转至首页!"; //新文档时 HyoaClass.Hyoa_mystyle Hyoa_mystyle = new HyoaClass.Hyoa_mystyle(); if (this.txtdocid.Value == "") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); Hyoa_mystyle.ID = Hyoa_global.GetRandom(); Hyoa_mystyle.hy_userid = this.txtuserid.Text; Hyoa_mystyle.hy_style = this.ddlhy_style.SelectedValue.ToString(); Hyoa_mystyle.Insert(); } else { Hyoa_mystyle.ID = this.txtdocid.Value; Hyoa_mystyle.hy_userid = this.txtuserid.Text; Hyoa_mystyle.hy_style = this.ddlhy_style.SelectedValue.ToString(); Hyoa_mystyle.Update(); } Session["mystyle"] = ddlhy_style.SelectedValue.ToString(); Response.Write("<script>alert('" + ls_tip + "');window.top.location='/'</script>"); }
//保存或提交时的JS代码(判断是否必填项),动态架构 Written by xf 20110515 public string CheckfmMainInput() { string ls_mid = ""; if (this.Request.QueryString["mid"] != null) { ls_mid = this.Request.QueryString["mid"].ToString(); if (ls_mid.Contains(",")) ls_mid = ls_mid.Substring(0, ls_mid.IndexOf(",")); } string ls_tableid = ""; if (this.Request.QueryString["tableid"] != null) { ls_tableid = this.Request.QueryString["tableid"].ToString(); if (ls_tableid.Contains(",")) ls_tableid = ls_tableid.Substring(0, ls_tableid.IndexOf(",")); } string ls_return = ""; //如果是“可修改所有文档的权限人员”,则可以修改所有的字段,不需要提示是否必填了。 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.isHaveRole("Role9995", Session["hyuid"].ToString())) { } else { HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); //根据模块ID和表单ID得到对应的配置字段 DataTable dt_gettablecolumns = Hyoa_flowfield.GetflowfieldsbyMudelidAndTableid(ls_mid, ls_tableid); if (dt_gettablecolumns.Rows.Count > 0) { //判断是否必填 for (int i = 0; i < dt_gettablecolumns.Rows.Count; i++) { if (dt_gettablecolumns.Rows[i]["hy_required"].ToString() == "是") { if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "文本" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "多行文本" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "文本加按钮" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "多行文本加按钮" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "日期" || dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "口令") ls_return += "try{if(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".value==\"\"){alert(\"" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "不能为空!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".focus();return false;}}catch(err){}"; if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "数值") ls_return += "try{if(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".value==\"\"){alert(\"" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "不能为空!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".focus();return false;}if(isNaN(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".value)){alert(\"" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "必须为数值!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".focus();return false}}catch(err){}"; if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "对话框列表") ls_return += "try{if(fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".selectedIndex==0){alert(\"请选择" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "!\");fm." + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + ".focus();return false;}}catch(err){}"; //if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "复选框") // ls_return += "try{var ls_select=\"\";var obj1=document.getElementsById(\"" + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "\");for(var i = 0; i < obj1.length; i++){if(obj1[i].checked){if(ls_select==\"\"){ls_select = obj1[i].value;}else{ls_select=ls_select+\"#\"+obj1[i].value;}}}if(ls_select==\"\"){alert('请选择" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "!');return false;}}catch(err){}"; //if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "单选框") // ls_return += "try{var ls_select=\"\";var obj1=document.getElementsById(\"" + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "\");for(var i = 0; i < obj1.length; i++){if(obj1[i].checked){if(ls_select==\"\"){ls_select = obj1[i].value;}else{ls_select=ls_select+\"#\"+obj1[i].value;}}}if(ls_select==\"\"){alert('请选择" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "!');return false;}}catch(err){}"; } //哪个字段是待办事宜提醒的字段 edited by xf 20140625 if (dt_gettablecolumns.Rows[i]["hy_ifdbsybt"].ToString() == "是") { ls_return += "try{var d=document.getElementById('" + dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString() + "');if(d==null||typeof(d.value)=='undefined'){}else{document.getElementById('hy_bt').value=d.value;}}catch(err){}"; } } } } return ls_return; }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); if (!this.IsPostBack) { if (this.Request.QueryString["docid"] != null) { string ls_docid = this.Request.QueryString["docid"].ToString(); string ls_tableid = this.Request.QueryString["tableid"].ToString(); //根据文档ID得到记录 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = "select * from hyc_" + ls_tableid + " where DOCID='" + ls_docid + "'"; DataTable dt = Hyoa_global.GetDataTable(sql); string ls_flowid, ls_flowname, ls_mudelid, ls_curtacheid, ls_curtachename; if (dt.Rows.Count > 0) { ls_flowid = dt.Rows[0]["hy_flowid"].ToString(); //流程ID ls_flowname = dt.Rows[0]["hy_flowname"].ToString(); //流程名称 ls_mudelid = dt.Rows[0]["hy_mudelid"].ToString(); //模块ID ls_curtacheid = dt.Rows[0]["hy_curtacheid"].ToString(); //当前环节ID ls_curtachename = dt.Rows[0]["hy_curtachename"].ToString(); //当前环节名称 dt.Clear(); HyoaClass.Hyoa_cklc Hyoa_cklc_CurrnetDocFlow = new HyoaClass.Hyoa_cklc(); //制作表格式信息 this.txtCurrnetDocFlow.Value = Hyoa_cklc_CurrnetDocFlow.GetCurrnetDocFlow(ls_docid,ls_flowid,ls_flowname,ls_mudelid,ls_curtacheid,ls_curtachename); //制作流程图 this.txtFlowXML.Value = Hyoa_cklc_CurrnetDocFlow.GetXmlBody(ls_docid, ls_flowid, ls_flowname, ls_mudelid, ls_curtacheid, ls_curtachename); } } } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "提交成功!"; string ls_insert = ""; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); ls_insert = "insert into hyp_gzlxdhf (id,hy_jsrdocid,hy_fsrdocid,hy_userid,hy_username,hy_deptid,hy_deptname,hy_time,hy_body,hy_ip,hy_ifshow)"; ls_insert += " values ('" + Hyoa_global.GetRandom() + "','" + this.txtid.Value + "','" + this.txtdocid.Value + "','" + this.Session["hyuid"].ToString() + "'"; ls_insert += ",'" + this.Session["hyuname"].ToString() + "','" + this.Session["hydeptid"].ToString() + "','" + this.Session["hydeptname"].ToString() + "'"; ls_insert += ",'" + System.DateTime.Now.ToString() + "','" + this.txthfnr.Text + "','" + HttpContext.Current.Request.UserHostAddress + "','')"; Hyoa_global.ExcuteSQL(ls_insert); //收件中置为已回复 string ls_update; ls_update = "update hyp_wjcd set hy_ifyhf='1' where ID='" + this.txtid.Value + "' "; Hyoa_global.ExcuteSQL(ls_update); //处理完成后的提示及跳转 Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
////保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "发表文章成功!"; HyoaClass.Hyoa_boke_main Hyoa_boke_main = new HyoaClass.Hyoa_boke_main(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); Hyoa_boke_main.DOCID = Hyoa_global.GetRandom(); Hyoa_boke_main.hy_djrid = this.Session["hyuid"].ToString(); Hyoa_boke_main.hy_djrname = this.Session["hyuname"].ToString(); Hyoa_boke_main.hy_djsj = System.DateTime.Now.ToString(); Hyoa_boke_main.hy_bt = this.txtbt.Text; Hyoa_boke_main.hy_content = this.Content.Value; Hyoa_boke_main.hy_visits = 0; if (Hyoa_boke_main.Insert() == true) { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { this.Response.Write("<script>alert('发表文章失败,请联系管理员!')</script>"); } }
protected void Page_Load(object sender, EventArgs e) { string ls_docids=""; string ls_filepath=""; if (this.Request.QueryString["docids"] != null) { ls_docids = this.Request.QueryString["docids"].ToString(); } string[] lv_docids; lv_docids = ls_docids.Split(','); HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); DataTable dt = new DataTable(); for (int j = 0; j < lv_docids.Length; j++) { dt = Hyoa_fileatt.Getfileatt(lv_docids[j]); if (dt.Rows[0]["hy_userid"].ToString() == Session["hyuid"].ToString() || Hyoa_global.isHaveRole("Role9995", Session["hyuid"].ToString())) { ls_filepath = Server.MapPath("~/") + dt.Rows[0]["hy_filepath"].ToString(); //this.Response.Write(ls_filepath); //return; if (File.Exists(ls_filepath)) { System.IO.File.Delete(ls_filepath); } Hyoa_fileatt.ID = lv_docids[j]; Hyoa_fileatt.Delete(); } dt.Clear(); } this.Response.Write("aaa"); return ; }
//左侧导航(一级及以下目录) public string hy_nav() { string hy_nav = ""; if (Request.QueryString["mlid"] != null) { this.ls_mlid = Request.QueryString["mlid"].ToString(); this.ls_mlid_fir = Request.QueryString["mlid"].ToString(); if (this.ls_mlid_fir.Length > 3) { this.ls_mlid_fir = this.ls_mlid_fir.Substring(0, 3); } } HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //得到一级目录 HyoaClass.Hyoa_ml Hyoa_ml = new HyoaClass.Hyoa_ml(); DataTable dt = Hyoa_ml.GetFirstmls(); if (dt.Rows.Count > 0) { string ls_flag1 = "0"; //无权限 int j = 0; for (int i = 0; i < dt.Rows.Count; i++) { ls_flag1 = "0"; //输出一级 if (dt.Rows[i]["hy_role"].ToString() == "" || dt.Rows[i]["hy_role"] == null) { ls_flag1 = "1"; //有权限(没有设置role) } else { if (Hyoa_global.isHaveRole(dt.Rows[i]["hy_role"].ToString(), Session["hyuid"].ToString())) { ls_flag1 = "1"; //有权限 } } if (dt.Rows[i]["hy_ifqy"].ToString() != "是") { //未启用,直接赋为无权限 ls_flag1 = "0"; } if (ls_flag1 == "1") { if (this.ls_mlid_fir == "") { this.ls_mlid_fir = dt.Rows[i]["MLID"].ToString(); //如果ls_mlid_fir还是空值则表示URL没有传过来参数,则显示第一个能显示的一级栏目 } if (this.ls_mlid_fir == dt.Rows[i]["MLID"].ToString()) { hy_nav += "<div title=\"<img src=" + dt.Rows[i]["hy_pic"].ToString() + " /> " + dt.Rows[i]["MLName"].ToString() + "\" iconcss=\"menu-icon-model\" class=\"l-scroll\" >"; hy_nav += "<ul id=\"global_channel_tree" + (j + 1).ToString() + "\" style=\"margin-top: 3px;\">"; hy_nav += GetSecMl(dt.Rows[i]["MLID"].ToString()); hy_nav += "</ul>"; hy_nav += "</div>"; j += 1; } } } } return hy_nav; }
////保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "评论成功!"; HyoaClass.Hyoa_boke_reback Hyoa_boke_reback = new HyoaClass.Hyoa_boke_reback(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); Hyoa_boke_reback.DOCID = Hyoa_global.GetRandom(); Hyoa_boke_reback.hy_fatherid = this.txtfatherid.Value; Hyoa_boke_reback.hy_content = this.Content.Value; Hyoa_boke_reback.hy_djsj = System.DateTime.Now.ToString(); Hyoa_boke_reback.hy_djrid = this.Session["hyuid"].ToString(); Hyoa_boke_reback.hy_djrname = this.Session["hyuname"].ToString(); string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; //得到客户端IP } Hyoa_boke_reback.hy_ip = userip; if (Hyoa_boke_reback.Insert() == true) { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { this.Response.Write("<script>alert('发表评论失败,请联系管理员!')</script>"); } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; string ls_attsize = ""; string str_path = ""; string lspath = ""; string lsguid = ""; string lsurl = ""; string lsfilename = ""; string lshy_fatherfield = ""; lsfilename = FileUpload1.FileName; HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (lsfilename != "") //attsize { lshy_fatherfield = ""; ls_attsize = System.Convert.ToString(System.Convert.ToDouble(System.Convert.ToInt32(System.Convert.ToDouble(FileUpload1.PostedFile.ContentLength.ToString()) / 1024 / 1024 * 1000)) / 1000);//附件的大小 lsguid = Hyoa_global.GetRandom(); System.Console.WriteLine(lsguid); //SaveCommon(ls_path, ls_attsize, lsguid); //将附件上传到服务器目录下 lspath = Server.MapPath("~/");//虚拟目录的位置 lsurl = "fileatt\\" + lsguid; //存放的文件夹 Directory.CreateDirectory(lspath + "\\" + lsurl); str_path = lspath + "\\" + lsurl + "\\" + lsfilename; FileUpload1.SaveAs(str_path); Hyoa_fileatt.ID = lsguid; Hyoa_fileatt.hy_fatherid = this.txtfatherid.Value; if (this.txtfilename.Text == "") { Hyoa_fileatt.hy_filename = lsfilename; } else { Hyoa_fileatt.hy_filename = this.txtfilename.Text; } Hyoa_fileatt.hy_filepath = lsurl + "\\" + lsfilename; Hyoa_fileatt.hy_filesize = ls_attsize; Hyoa_fileatt.hy_userid = this.Session["hyuid"].ToString(); Hyoa_fileatt.hy_djsj = System.DateTime.Now.ToString(); if (this.Request.QueryString["fatherfield"] != null) { lshy_fatherfield = this.Request.QueryString["fatherfield"].ToString(); ////父文档配置的域名 } Hyoa_fileatt.hy_fatherfield = lshy_fatherfield; Hyoa_fileatt.Insert(); } else { this.Response.Write("<script>alert('请选择要上传的文件!');</script>"); } Response.Write("<script>alert('" + ls_tip + "');var lsurl = window.location.href;window.location = lsurl;window.opener.document.getElementById('btn_sxfj').onclick(); </script>"); }
protected void Page_Load(object sender, EventArgs e) { string ls_value1 = ""; string ls_value2 = ""; if (this.Request.QueryString["lsvalue1"] != null) { ls_value1 = this.Request.QueryString["lsvalue1"].ToString(); //类别 } if (this.Request.QueryString["lsvalue2"] != null) { ls_value2 = this.Request.QueryString["lsvalue2"].ToString(); //年份 } //Response.Write(ls_value2); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string lssql = "select hyc_lsh from hyc_TableLsh where hyc_lb='" + ls_value1 + "' and hyc_nf='" + ls_value2 + "'"; //Response.Write(lssql); DataTable dt = Hyoa_global.GetDataTable(lssql); if (dt.Rows.Count > 0) { this.Response.Write(dt.Rows[0][0].ToString()); } else { this.Response.Write("1"); } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; //新文档时 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_bq Hyoa_bq = new HyoaClass.Hyoa_bq(); if (this.txtop.Value == "modify") { Hyoa_bq.hy_userid = this.txtdjrid.Value; Hyoa_bq.hy_body = this.txtbody.Text; Hyoa_bq.hy_datetime = System.DateTime.Now.ToString(); Hyoa_bq.hy_tag = ""; Hyoa_bq.Update(); }else{ Hyoa_bq.hy_userid = this.txtdjrid.Value; Hyoa_bq.hy_body = this.txtbody.Text; Hyoa_bq.hy_datetime = System.DateTime.Now.ToString(); Hyoa_bq.hy_tag = ""; Hyoa_bq.Insert(); } Response.Write("<script>alert('" + ls_tip + "');window.location='main_bq.aspx?op=modify'</script>"); }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; //新文档时 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_publicidea Hyoa_publicidea = new HyoaClass.Hyoa_publicidea(); if (this.txtop.Value == "add") { Hyoa_publicidea.ID = Hyoa_global.GetRandom(); Hyoa_publicidea.hy_idea = this.txtname.Value; Hyoa_publicidea.hy_sort = System.Int32.Parse(this.txtsort.Value); Hyoa_publicidea.Insert(); } else { Hyoa_publicidea.ID = this.txtdocid.Value; Hyoa_publicidea.hy_idea = this.txtname.Value; Hyoa_publicidea.hy_sort = System.Int32.Parse(this.txtsort.Value); Hyoa_publicidea.Update(); } //处理完成后的提示及跳转 if (this.txtifpop.Value == "") { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { Response.Write("<script>alert('" + ls_tip + "');self.close();</script>"); } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { string ls_tip = "保存成功!"; try { string[] lv_jsrsysname, lv_jsrcnname;//接收人系统名、中文名 lv_jsrsysname = this.f_ReceivesysNameList.Value.ToString().Split('+'); lv_jsrcnname = this.f_ReceiveChNameList.Value.ToString().Split('+'); HyoaClass.Hyoa_sms Hyoa_sms = new HyoaClass.Hyoa_sms(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); DataTable dt; for (int i = 0; i < lv_jsrsysname.Length; i++) { Hyoa_sms.ID = Hyoa_global.GetRandom(); Hyoa_sms.DOCID = Hyoa_global.GetRandom(); Hyoa_sms.hy_fsrid = this.txtdjrid.Value; Hyoa_sms.hy_fsrname = this.f_SendChName.Text; Hyoa_sms.hy_fsrsjh = this.f_SendMobileNo.Text; Hyoa_sms.hy_jsrid = lv_jsrsysname[i]; Hyoa_sms.hy_jsrname = lv_jsrcnname[i]; dt = Hyoa_user.Getuserallinfobyloginid(lv_jsrsysname[i]); if (dt.Rows.Count > 0) { Hyoa_sms.hy_jsrsjh = dt.Rows[0]["hy_mobile"].ToString(); } else { Hyoa_sms.hy_jsrsjh = lv_jsrsysname[i]; } Hyoa_sms.hy_createtime = System.DateTime.Now.ToString(); Hyoa_sms.hy_from = ""; Hyoa_sms.hy_content = this.f_smsContents.Text; Hyoa_sms.hy_isnowsend = 1; Hyoa_sms.hy_takedate = ""; Hyoa_sms.hy_taketime = ""; Hyoa_sms.hy_state = 0; Hyoa_sms.hy_tableid = "Mudelsms"; Hyoa_sms.Insert(); } } catch { } finally { //处理完成后的提示及跳转 if (this.txtifpop.Value == "") { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { Response.Write("<script>alert('" + ls_tip + "');self.close();</script>"); } } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_roleuser Hyoa_roleuser = new HyoaClass.Hyoa_roleuser(); ////---增加模块权限------- if (this.fdAddRoleid.Value != "") { string[] v_AddRoleid = this.fdAddRoleid.Value.Split(','); for (var i = 0; i < v_AddRoleid.Length; i++) { Hyoa_roleuser.ID = Hyoa_global.GetRandom(); Hyoa_roleuser.hy_roleid = v_AddRoleid[i].ToString(); Hyoa_roleuser.hy_userid = this.txtuserid.Value; Hyoa_roleuser.Insert(); } } ////---删除模块权限------- if (this.fdDelRoleid.Value != "") { string[] v_DelRoleid = this.fdDelRoleid.Value.Split(','); for (var i = 0; i < v_DelRoleid.Length; i++) { Hyoa_roleuser.Deletebyroleidanduserid(v_DelRoleid[i].ToString(), this.txtuserid.Value); } } HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); ////---增加流程权限------- if (this.fdAddFlowTacheid.Value != "") { string[] v_AddFlowTacheid = this.fdAddFlowTacheid.Value.Split(','); for (var i = 0; i < v_AddFlowTacheid.Length; i++) { Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom(); Hyoa_flowtacheuser.hy_flowid = v_AddFlowTacheid[i].ToString().Substring(0,v_AddFlowTacheid[i].ToString().IndexOf('^')); Hyoa_flowtacheuser.hy_tacheid = v_AddFlowTacheid[i].ToString().Substring(v_AddFlowTacheid[i].ToString().IndexOf('^')+1, (v_AddFlowTacheid[i].ToString().Length - v_AddFlowTacheid[i].ToString().IndexOf('^')-1)); Hyoa_flowtacheuser.hy_userid = this.txtuserid.Value; Hyoa_flowtacheuser.Insert(); } } //---删除流程权限------- if (this.fdDelFlowTacheid.Value != "") { string[] v_DelFlowTacheid = this.fdDelFlowTacheid.Value.Split(','); string ls_flowid; string ls_tacheid; for (var i = 0; i < v_DelFlowTacheid.Length; i++) { ls_flowid = v_DelFlowTacheid[i].ToString().Substring(0, v_DelFlowTacheid[i].ToString().IndexOf('^')); ls_tacheid = v_DelFlowTacheid[i].ToString().Substring(v_DelFlowTacheid[i].ToString().IndexOf('^') + 1, (v_DelFlowTacheid[i].ToString().Length - v_DelFlowTacheid[i].ToString().IndexOf('^') - 1)); Hyoa_flowtacheuser.Deletebyroleidtacheiduserid(ls_flowid, ls_tacheid, this.txtuserid.Value); } } Response.Write("<script>alert('保存成功!');self.close();</script>"); }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("/login.aspx"); string ls_tip = "保存成功!"; //新文档时 string lscolunid = "", sql = ""; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.DAO db = new HyoaClass.DAO(); if (this.txtselcolid.Value =="") { Response.Write("<script>alert('请选择查询的字段!');window.location.href = window.location.href;</script>"); return; } if (this.txtop.Value == "add") { //判断是否重复 string sql1 = "select * from hyt_searchconfig where hy_mudelid='" + this.ddlmudelid.SelectedValue + "' and hy_tableid='" + this.ddltableid.SelectedValue + "'"; DataTable dt = db.GetDataTable(sql1); if (dt.Rows.Count > 0) { Response.Write("<script>alert('该模块已添加,请修改!');window.location.href = window.location.href;</script>"); return; } lscolunid = Hyoa_global.GetRandom(); sql = "insert into hyt_searchconfig (ID,hy_mudelid,hy_tableid,hy_sort,hy_columnshowid,hy_columnshow,hy_ifsearch,hy_xszdid,hy_xszd,hy_kckry,hy_kckryid) values ("; sql += "'" + lscolunid + "','" + this.ddlmudelid.SelectedValue + "','" + this.ddltableid.SelectedValue + "'," + float.Parse(this.txtsort.Text) + ""; sql += ",'" + this.txtselcolid.Value + "','" + this.txtselcol.Value + "','" + this.ddlifsearch.SelectedValue + "'"; sql += ",'" + this.txtselsearchid.Value + "','" + this.txtselsearch.Value + "','" + this.hy_field41_1.Value + "','" + this.hy_field43_1.Value + "')"; db.Execute(sql); } else { sql = "update hyt_searchconfig set hy_mudelid='" + this.ddlmudelid.SelectedValue + "', hy_tableid='" + this.ddltableid.SelectedValue + "',"; sql += "hy_sort=" + float.Parse(this.txtsort.Text) + ",hy_columnshowid='" + this.txtselcolid.Value + "',hy_columnshow='" + this.txtselcol.Value + "',"; sql += " hy_ifsearch='" + this.ddlifsearch.SelectedValue + "',hy_xszdid='" + this.txtselsearchid.Value + "',hy_xszd='" + this.txtselsearch.Value + "', "; sql += " hy_kckry='" + this.hy_field41_1.Value + "',hy_kckryid='" + this.hy_field43_1.Value + "' where ID='" + this.txtdocid.Value + "'"; db.Execute(sql); } db.Close(); //处理完成后的提示及跳转 if (this.txtifpop.Value == "") { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { Response.Write("<script>alert('" + ls_tip + "');self.close();</script>"); } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; //新文档时 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_gwk Hyoa_gwk = new HyoaClass.Hyoa_gwk(); if (this.txtop.Value == "add") { Hyoa_gwk.ID = this.txtdocid.Value; Hyoa_gwk.hy_djrid = this.Session["hyuid"].ToString(); Hyoa_gwk.hy_djrname = this.Session["hyuname"].ToString(); Hyoa_gwk.hy_djbmid = this.Session["hydeptid"].ToString(); Hyoa_gwk.hy_djbmname = this.Session["hydeptname"].ToString();; Hyoa_gwk.hy_bt = this.txthy_bt.Value; Hyoa_gwk.hy_wh = this.txthy_wh.Value; Hyoa_gwk.hy_lwwh = ""; Hyoa_gwk.hy_djsj = System.DateTime.Now.ToString(); Hyoa_gwk.hy_fatherid = ""; Hyoa_gwk.hy_typeid = this.txttypeid.Value; Hyoa_gwk.hy_typename = this.txthy_typename.Value; Hyoa_gwk.Insert(); } else { Hyoa_gwk.ID = this.txtdocid.Value; Hyoa_gwk.hy_djrid = this.Session["hyuid"].ToString(); Hyoa_gwk.hy_djrname = this.Session["hyuname"].ToString(); Hyoa_gwk.hy_djbmid = this.Session["hydeptid"].ToString(); Hyoa_gwk.hy_djbmname = this.Session["hydeptname"].ToString(); Hyoa_gwk.hy_bt = this.txthy_bt.Value; Hyoa_gwk.hy_wh = this.txthy_wh.Value; Hyoa_gwk.hy_lwwh = ""; Hyoa_gwk.hy_djsj = System.DateTime.Now.ToString(); Hyoa_gwk.hy_fatherid = ""; Hyoa_gwk.hy_typeid = this.txttypeid.Value; Hyoa_gwk.hy_typename = this.txthy_typename.Value; Hyoa_gwk.Update(); } //处理完成后的提示及跳转 if (this.txtifpop.Value == "") { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { Response.Write("<script>alert('" + ls_tip + "');self.close();</script>"); } }
protected void Button_Save_Getdt_Click(object sender, EventArgs e) { if (txtsql_getdt.Text != "") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = this.txtsql_getdt.Text; DataTable dt = Hyoa_global.GetDataTable(sql); lbldt.Text = ""; if (dt.Rows.Count > 0) { lbldt.Text = "<table width='100%' border='1'>"; for (int i = 0; i < dt.Rows.Count; i++) { if (i == 0) { lbldt.Text += "<tr>"; lbldt.Text += "<td>"; lbldt.Text += "序号"; lbldt.Text += "</td>"; for (int k = 0; k < dt.Columns.Count; k++) { lbldt.Text += "<td>"; lbldt.Text += dt.Columns[k].ColumnName.ToString(); lbldt.Text += "</td>"; } lbldt.Text += "</tr>"; } lbldt.Text += "<tr>"; lbldt.Text += "<td>"; lbldt.Text += (i + 1).ToString(); lbldt.Text += "</td>"; for (int j = 0; j < dt.Columns.Count; j++) { lbldt.Text += "<td>"; if (dt.Rows[i][j].ToString() == "") lbldt.Text += " "; else lbldt.Text += dt.Rows[i][j].ToString(); lbldt.Text += "</td>"; } lbldt.Text += "</tr>"; } lbldt.Text += "</table>"; } } else { Response.Write("<script>alert('请填写SQL语句');window.location='excutesql.aspx'</script>"); } }
protected void Page_Load(object sender, EventArgs e) { string strDwmc = ""; string sqlSelect = ""; if (Request.QueryString["dwmc"] != null) { strDwmc = Request.QueryString["dwmc"].ToString(); } HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); List<DateTime> list = new List<DateTime>(); List<string> ls_key = new List<string>(); //合同表单id string[] arryStr = new string[] { "Tablesyyhfwxy", "Tablejdhazfwht", "TableVODfwxy", "Tableffpdfwht", "TableDVBazfwdght", "Tablejwdsjsxy", "Tablejwdscsxy", "Tablekdjrht", "Tablesjcsfwht", "Tablesjgdcsfwht", "Tablesjtxyyhzxy", "Tablezdyht" }; //将所有表单的登记时间和DOCID Tableid放入集合中 for (int i = 0; i < arryStr.Length; i++) { sqlSelect = " select DOCID,hy_mudelid,hy_tableid,hy_djsj from hyc_" + arryStr[i] + " where hyc_jfmc='" + strDwmc + "' order by hy_djsj desc "; DataTable dt = Hyoa_global.GetDataTable(sqlSelect); //获取每个表单一个的表单id 表名 和登记时间 if (dt.Rows.Count > 0) { list.Add(Convert.ToDateTime(dt.Rows[0]["hy_djsj"].ToString())); ls_key.Add(dt.Rows[0]["DOCID"].ToString() + "#" + dt.Rows[0]["hy_mudelid"].ToString() + "#" + dt.Rows[0]["hy_tableid"].ToString()); } } if ((list != null && list.Count > 0) && (ls_key != null && ls_key.Count > 0)) { string temp_string = ""; DateTime temp_dateTime; for (int m = 0; m < list.Count; m++) { for (int n = 0; n < list.Count - 1; n++) { if (list[n] < list[n + 1]) { temp_dateTime = list[n]; list[n] = list[n + 1]; list[n + 1] = temp_dateTime; temp_string = ls_key[n]; ls_key[n] = ls_key[n + 1]; ls_key[n + 1] = temp_string; } } } Response.Write(ls_key[0]); } else { Response.Write("空值"); } }
protected void Page_Load(object sender, EventArgs e) { string ls_value = ""; //后续处理人 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(Request.QueryString["flowid"].ToString(), Request.QueryString["tacheid"].ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql_tj = ""; if (Session["conntype"].ToString() == "SQL") { sql_tj = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql_tj = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } DataTable dt2 = Hyoa_global.GetDataTable_USER(sql_tj); if (dt2.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt2.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt2.Rows[i]["hy_userid"].ToString() + ",")) { } else { if (ls_value == "") { ls_value = dt2.Rows[i]["hy_userid"].ToString() + "+" + dt2.Rows[i]["hy_username"].ToString(); } else { ls_value += "," + dt2.Rows[i]["hy_userid"].ToString() + "+" + dt2.Rows[i]["hy_username"].ToString(); } t += 1; ls_temp1 += "," + dt2.Rows[i]["hy_userid"].ToString(); } } } } Response.Write(ls_value); }
private void DataPlay() { string lsydry=""; if (this.Request.QueryString["docid"] != null) { string ls_docid = this.Request.QueryString["docid"].ToString(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string lssql = "select * from hyc_" + Request.QueryString["tableid"].ToString() + " where DOCID='" + ls_docid + "'"; DataTable dt = Hyoa_global.GetDataTable(lssql); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); string lsusername = ""; if(dt.Rows.Count>0) { lsusername = ""; string[] lvhy_readuserlist; string[] lvhy_readdatelist; lvhy_readuserlist = dt.Rows[0]["hy_readuserlist"].ToString().Split(','); lvhy_readdatelist = dt.Rows[0]["hy_readdatelist"].ToString().Split(','); for (int j = 1; j < lvhy_readuserlist.Length; j++) { lsydry += "<TR height=27px>"; lsydry += "<TD align=\"center\" class=\"Tdcellright\">"+j.ToString()+"</TD>"; DataTable dtuser = Hyoa_user.Getuserallinfobyloginid(lvhy_readuserlist[j]); if (dtuser.Rows.Count > 0) { lsusername = dtuser.Rows[0]["hy_username"].ToString(); } else { lsusername = "******"; } dtuser.Clear(); lsydry += "<TD align=\"center\" class=\"Tdcellright\">" + lsusername + "</TD>"; if (lvhy_readdatelist.Length > j) { lsydry += "<TD align=\"center\" class=\"Tdcellright\">" + lvhy_readdatelist[j] + "</TD>"; } else { lsydry += "<TD align=\"center\" class=\"Tdcellright\"> </TD>"; } lsydry += "</TR>"; } } this.lblydry.Text = lsydry; } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { if (this.Request.QueryString["pop"] != null) { this.txtifpop.Value = this.Request.QueryString["pop"].ToString(); //是否弹出窗口 } //esppath = Server.MapPath("esp"); //if (this.Session["hyuid"].ToString() == "") // this.Response.Redirect("../login.aspx"); if (Request.QueryString["url"] != null) { this.url.Value = Request.QueryString["url"].ToString(); } if (Request.QueryString["espid"] != null) { this.txtdocid.Value = Request.QueryString["espid"].ToString(); } //按钮控制 this.tdCreateNew.Visible = false; this.tdSave.Visible = false; //判断当前用户是否有新建删除权限 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string ls_mudelid = "Mudelfwgl"; string ls_role = ""; HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel(); DataTable dt_mudel = Hyoa_mudel.Getmudel(ls_mudelid); if (dt_mudel.Rows.Count > 0) { ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString(); } if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString())) { if (Request.QueryString["op"] != null) { string ls_op = Request.QueryString["op"].ToString(); txtop.Value = ls_op; if (ls_op == "add") { this.tdCreateNew.Visible = true; this.tdSave.Visible = true; this.txtdocid.Value = Hyoa_global.GetRandom(); } } } } }
protected void Button_Save_Click(object sender, EventArgs e) { if (txtsql.Text != "") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = this.txtsql.Text; Hyoa_global.ExcuteSQL(sql); Response.Write("<script>alert('提交成功');window.location='excutesql.aspx'</script>"); } else { Response.Write("<script>alert('请填写SQL语句');window.location='excutesql.aspx'</script>"); } }
protected void btnLogin_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt = Hyoa_tableconfig.GetTables(); string sql = ""; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //增加字段,先删除再添加 sql = "ALTER TABLE hyc_" + dt.Rows[i]["ID"].ToString(); sql += " ADD hy_clrylist text "; Hyoa_global.ExcuteSQL(sql); sql = "ALTER TABLE hyc_" + dt.Rows[i]["ID"].ToString(); sql += " ADD hy_cyrylist text "; //Hyoa_global.ExcuteSQL(sql); //第一次要执行一下添加字段 //处理数据 sql = "select * from hyc_" + dt.Rows[i]["ID"].ToString(); DataTable dt2 = Hyoa_global.GetDataTable(sql); if (dt2.Rows.Count > 0) { for (int j = 0; j < dt2.Rows.Count; j++) { //先置为, sql = "update hyc_" + dt.Rows[i]["ID"].ToString() + " set hy_clrylist=',',hy_cyrylist=',' where DOCID='" + dt2.Rows[j]["DOCID"].ToString() + "'"; Hyoa_global.ExcuteSQL(sql); //再根据cl表更新 sql = "select * from hyp_flowhistoryinfo_cl where DOCID='" + dt2.Rows[j]["DOCID"].ToString() + "'"; DataTable dt3 = Hyoa_global.GetDataTable(sql); if (dt3.Rows.Count > 0) { for (int m = 0; m < dt3.Rows.Count; m++) { //得到初始值 sql = "select * from hyc_" + dt.Rows[i]["ID"].ToString() + " where DOCID='" + dt2.Rows[j]["DOCID"].ToString() + "'"; DataTable dt4 = Hyoa_global.GetDataTable(sql); string ls_value = dt4.Rows[0]["hy_clrylist"].ToString() + dt3.Rows[m]["hy_clrid"].ToString() + ","; sql = "update hyc_" + dt.Rows[i]["ID"].ToString() + " set hy_clrylist='" + ls_value + "',hy_cyrylist=',' where DOCID='" + dt2.Rows[j]["DOCID"].ToString() + "'"; //Response.Write(sql); Hyoa_global.ExcuteSQL(sql); } } } } } } Response.Write("更新完成"); }
//ntko_class db = new ntko_class();//实例ntko_class类 protected void Page_Load(object sender, EventArgs e) { //title = db.getdemotitle(); //attachpath = db.getattachpath(); title = "宁波合益"; newofficetype = Request.QueryString["newofficetype"]; HyoaClass.Hyoa_ntko Hyoa_ntko = new HyoaClass.Hyoa_ntko(); tableid=""; if (this.Request.QueryString["tableid"] != null) { tableid = this.Request.QueryString["tableid"].ToString(); } if (this.Request.QueryString["fatherid"] != null) { fatherid = this.Request.QueryString["fatherid"].ToString(); DataTable dtfatherid = Hyoa_ntko.GetntkofileByfother(fatherid); //this.Response.Write("<script>alert('" + dtfatherid.Rows.Count + "');</script>"); if (dtfatherid.Rows.Count > 0) { url = dtfatherid.Rows[0]["fid"].ToString(); DataTable dt = Hyoa_ntko.Getntkofile(url); if (dt.Rows.Count > 0) { fileid = dt.Rows[0]["fid"].ToString(); filetitle = dt.Rows[0]["ftitle"].ToString(); fileother = dt.Rows[0]["fother"].ToString(); filename = dt.Rows[0]["fname"].ToString(); } } //隐藏控制(根据fatherid) string ls_flowid = ""; string ls_currenttacheid = ""; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = "select * from hyc_" + tableid + " where DOCID='" + fatherid + "' "; DataTable dt_flowmain = Hyoa_global.GetDataTable(sql); if (dt_flowmain.Rows.Count > 0) { if (dt_flowmain.Rows[0]["hy_curtacheid"].ToString() == "**") ckhjbl.Visible = true; } } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("/login.aspx"); string ls_tip = "保存成功!"; //新文档时 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_iplimit Hyoa_iplimit = new HyoaClass.Hyoa_iplimit(); if (this.txtop.Value == "add") { //先判断这个模块编号是否已经存在 DataTable dt = Hyoa_iplimit.Getiplimitsbymudelid(this.ddlmudelid.SelectedValue); if (dt.Rows.Count > 0) { Response.Write("<script>alert('该模块的IP限制已存在,请重新填写!');history.back();</script>"); return; } else { Hyoa_iplimit.ID = Hyoa_global.GetRandom(); Hyoa_iplimit.hy_mudelid = this.ddlmudelid.SelectedValue; Hyoa_iplimit.hy_iplists = this.txtiplists.Value; Hyoa_iplimit.hy_createtime = System.DateTime.Now.ToString(); Hyoa_iplimit.hy_isenabled = this.ddlisenabled.SelectedValue; Hyoa_iplimit.Insert(); } } else { Hyoa_iplimit.ID = this.txtdocid.Value; Hyoa_iplimit.hy_mudelid = this.ddlmudelid.SelectedValue; Hyoa_iplimit.hy_iplists = this.txtiplists.Value; Hyoa_iplimit.hy_createtime = System.DateTime.Now.ToString(); Hyoa_iplimit.hy_isenabled = this.ddlisenabled.SelectedValue; Hyoa_iplimit.Update(); } //处理完成后的提示及跳转 if (this.txtifpop.Value == "") { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { Response.Write("<script>alert('" + ls_tip + "');self.close();</script>"); } }
private void DataPlay() { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (this.Request.QueryString["id"] != null) { this.txtid.Value = this.Request.QueryString["id"].ToString(); } HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); DataTable dt = Hyoa_mail.Getmail(this.txtid.Value); if (dt.Rows.Count > 0) { this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString(); this.txtid.Value = dt.Rows[0]["ID"].ToString(); this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); this.txtfsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString(); this.txtfrsname.Text = dt.Rows[0]["hy_fsrname"].ToString(); this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString(); this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString(); this.lblhy_title.Text = dt.Rows[0]["hy_title"].ToString(); //附件 HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value); if (dt_fileatt.Rows.Count > 0) { string ls_temp = ""; for (var i = 0; i < dt_fileatt.Rows.Count; i++) { ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />"; } this.lblhy_field2.Text = ls_temp; } this.lblhy_content1.Text = dt.Rows[0]["hy_body"].ToString(); } //20120210 start string sccksj = System.DateTime.Now.ToString(); string sql = ""; if (dt.Rows[0]["hy_type"].ToString() == "收件" & dt.Rows[0]["hy_sccksj"].ToString() == "") { sql = "update hyt_mail set hy_sccksj = '" + sccksj + "' where ID='" + this.txtid.Value + "' "; Hyoa_global.ExcuteSQL(sql); } //20120210 end }
protected void Page_Load(object sender, EventArgs e) { string strDocid = ""; if (Request.QueryString["strDocid"] != null) { strDocid = Request.QueryString["strDocid"].ToString(); } string sqlSelect = " select hyc_dwmc from hyc_Tablekhda where docid='"+strDocid+"' "; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); DataTable dt = Hyoa_global.GetDataTable(sqlSelect); if (dt.Rows.Count > 0) { Response.Write(dt.Rows[0]["hyc_dwmc"].ToString()); } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "上传成功!"; string ls_attsize = ""; string str_path = ""; string lspath = ""; string lsguid = ""; string lsurl = ""; string lsfilename = ""; string lshy_fatherfield = ""; lsfilename = FileUpload1.FileName; HyoaClass.Hyoa_boke_headpic Hyoa_boke_headpic = new HyoaClass.Hyoa_boke_headpic(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (lsfilename != "") //attsize { //先删除再插入 Hyoa_boke_headpic.Delete(this.Session["hyuid"].ToString()); //删除 //插入 lshy_fatherfield = ""; ls_attsize = System.Convert.ToString(System.Convert.ToDouble(System.Convert.ToInt32(System.Convert.ToDouble(FileUpload1.PostedFile.ContentLength.ToString()) / 1024 / 1024 * 1000)) / 1000);//附件的大小 lsguid = Hyoa_global.GetRandom(); System.Console.WriteLine(lsguid); //SaveCommon(ls_path, ls_attsize, lsguid); //将附件上传到服务器目录下 lspath = Server.MapPath("~/");//虚拟目录的位置 lsurl = "fileatt\\" + lsguid; //存放的文件夹 Directory.CreateDirectory(lspath + "\\" + lsurl); str_path = lspath + "\\" + lsurl + "\\" + lsfilename; FileUpload1.SaveAs(str_path); Hyoa_boke_headpic.DOCID = lsguid; Hyoa_boke_headpic.hy_picpath = lsurl + "\\" + lsfilename; Hyoa_boke_headpic.hy_userid = this.Session["hyuid"].ToString(); Hyoa_boke_headpic.Insert(); } else { this.Response.Write("<script>alert('请选择要上传的头像!');</script>"); } Response.Write("<script>alert('" + ls_tip + "');window.close(); </script>"); }
protected void Page_Load(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string ls_fsrid = ""; string ls_fsrname = ""; string ls_jsrid = ""; string ls_jsrname = ""; string ls_content = ""; string ls_id = ""; string ls_txfs = ""; string lssql = ""; string ls_update = ""; lssql = "select * from hyp_wjcd where hy_type='收件' and hy_ifyhf='0' and hy_txstatus='0' "; DataTable dt = Hyoa_global.GetDataTable(lssql); if (dt.Rows.Count > 0) { for (var i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["hy_txfs"].ToString() != "") { System.TimeSpan ts = System.DateTime.Parse(dt.Rows[i]["hy_jzsj"].ToString()) - System.DateTime.Parse(System.DateTime.Now.ToString("yyyy-MM-dd")); int day = ts.Days; //距离一天且是下午进行提醒 if (day == 1) { //string.Compare(DateTime.Now.ToString("HH:mm").ToString(), "11:00") > 0 & string.Compare(DateTime.Now.ToString("HH:mm").ToString(), "13:00") < 0 if (string.Compare(DateTime.Now.ToString("HH:mm").ToString(), "14:00") > 0) { ls_fsrid = dt.Rows[i]["hy_fsrid"].ToString(); ls_fsrname = dt.Rows[i]["hy_fsrname"].ToString(); ls_jsrid = dt.Rows[i]["hy_jsrid"].ToString(); ls_jsrname = dt.Rows[i]["hy_jsrname"].ToString(); ls_content = "请尽快办理[工作联系单]-" + dt.Rows[i]["hy_title"].ToString(); ls_id = dt.Rows[i]["ID"].ToString(); ls_txfs = dt.Rows[i]["hy_txfs"].ToString(); hysendxx2(ls_fsrid, ls_fsrname,ls_jsrid, ls_jsrname, ls_content, ls_id, ls_txfs); ls_update = "update hyp_wjcd set hy_txstatus='1' where hy_type='收件' and ID='" + ls_id + "' "; Hyoa_global.ExcuteSQL(ls_update); } } } } } }