本文整理汇总了C#中HyoaClass.DAO.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# HyoaClass.DAO.Dispose方法的具体用法?C# HyoaClass.DAO.Dispose怎么用?C# HyoaClass.DAO.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HyoaClass.DAO
的用法示例。
在下文中一共展示了HyoaClass.DAO.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button_Pub_Click
//.........这里部分代码省略.........
HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
string ls_yqmlists = "";
if (this.hy_field43.Text == "")
{
//从人员库中读取人员
DataTable dt = Hyoa_user.GetusersOrderbydeptsortandusersort();
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
string ls_jsrid = dt.Rows[i]["hy_userid"].ToString();
string ls_jsrname = dt.Rows[i]["hy_username"].ToString();
string ls_yqm = "";
string ls_yqms = GetRandom3();
if (ls_jsrid == "admin")
{
ls_yqm = "000" + ls_yqms;
}
else
{
ls_yqm = ls_jsrid.Substring(ls_jsrid.Length - 3) + ls_yqms; //获得6位数字的随机数
}
//string ls_dburl = "/wstp.aspx?yqm=" + ls_yqm + "&rnd=" + Hyoa_global.GetRandom();
string ls_dburl = "/wstp.aspx?rnd=" + Hyoa_global.GetRandom();
string ls_body = this.Session["hyuname"].ToString() + "发起投票,您的投票邀请码为:" + ls_yqm + "。<a href=" + ls_dburl + " target=\"_blank\">请点击进入</a>";
String ls_sql = "insert into hyt_mail(ID,DOCID,hy_type,hy_foldername,hy_fsrid,hy_fsrname,hy_jsrid,hy_wbjsrid,hy_jsrname,hy_title,hy_body,hy_datetime,hy_ifsavetofjx,hy_yxj,hy_yjbg,hy_zycd,hy_hz,hy_wbjszh) values ";
ls_sql += "('" + Hyoa_global.GetRandom() + "','" + Hyoa_global.GetRandom() + "','收件','收件箱','" + this.hy_djrid.Text + "','" + this.hy_djrname.Text + "','" + ls_jsrid + "','','" + ls_jsrname + "','" + this.hy_field23.Text + "','" + ls_body + "','" + System.DateTime.Now.ToString() + "','','','','','','') ";
db.Execute(ls_sql);
//将邀请码
if (ls_yqmlists == "")
{
ls_yqmlists = ls_yqm;
}
else
{
ls_yqmlists = ls_yqmlists + "+" + ls_yqm;
}
}
}
}
else
{
string ls_jsrid = this.hy_field43.Text;
string ls_jsrname = this.hy_field41.Text;
string[] lv_jsrid = ls_jsrid.Split('+');
string[] lv_jsrname = ls_jsrname.Split('+');
for (var i = 0; i < lv_jsrid.Length; i++)
{
if (lv_jsrid[i] != "")
{
string ls_yqm = "";
string ls_yqms = GetRandom3();
if (lv_jsrid[i] == "admin")
{
ls_yqm = "000" + ls_yqms;
}
else
{
ls_yqm = lv_jsrid[i].Substring(lv_jsrid[i].Length - 3) + ls_yqms; //获得6位数字的随机数
}
////发送待办
//string ls_dburl = "wstp.aspx?rnd=" + Hyoa_global.GetRandom();
//string ls_body = this.Session["hyuname"].ToString() + "发起投票,请您参与";
//Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_jsrid[i].ToString(), lv_jsrname[i].ToString(),
// this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), ls_dburl, "待办", this.hy_mudelid.Text, "待办箱", "一般", ls_body, "请参与", 0, "", "");
//给参与的人发送邮件
//string ls_dburl = "/wstp.aspx?yqm=" + ls_yqm + "&rnd=" + Hyoa_global.GetRandom();
string ls_dburl = "/wstp.aspx?rnd=" + Hyoa_global.GetRandom();
string ls_body = this.Session["hyuname"].ToString() + "发起投票,您的投票邀请码为:" + ls_yqm + "。<a href=" + ls_dburl + " target=\"_blank\">请点击进入</a>";
String ls_sql = "insert into hyt_mail(ID,DOCID,hy_type,hy_foldername,hy_fsrid,hy_fsrname,hy_jsrid,hy_wbjsrid,hy_jsrname,hy_title,hy_body,hy_datetime,hy_ifsavetofjx,hy_yxj,hy_yjbg,hy_zycd,hy_hz,hy_wbjszh) values ";
ls_sql += "('" + Hyoa_global.GetRandom() + "','" + Hyoa_global.GetRandom() + "','收件','收件箱','" + this.hy_djrid.Text + "','" + this.hy_djrname.Text + "','" + lv_jsrid[i].ToString() + "','','" + lv_jsrname[i].ToString() + "','" + this.hy_field23.Text + "','" + ls_body + "','" + System.DateTime.Now.ToString() + "','','','','','','') ";
db.Execute(ls_sql);
//将邀请码
if (ls_yqmlists == "")
{
ls_yqmlists = ls_yqm;
}
else
{
ls_yqmlists = ls_yqmlists + "+" + ls_yqm;
}
}
}
}
//更新表
string sql = "update hyp_flowmain set hy_field30='" + ls_yqmlists + "',hy_field100=1 where docid='" + this.txtdocid.Value + "'";
db.Execute(sql);
db.Close();
db.Dispose();
Response.Write("<script>alert('发布投票成功!');window.location = '/list_tpgl.aspx?mid=moduletpgl&tableid=bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd';</script>");
}
示例2: btnpubinfo_Click
//.........这里部分代码省略.........
if (ls_jsrid == "admin")
{
ls_yqm = "000" + ls_yqms;
}
else
{
ls_yqm = ls_jsrid.Substring(ls_jsrid.Length - 3) + ls_yqms; //获得6位数字的随机数
}
//string ls_dburl = "/wstp.aspx?yqm=" + ls_yqm + "&rnd=" + Hyoa_global.GetRandom();
string ls_dburl = "/wstp.aspx?rnd=" + Hyoa_global.GetRandom();
string ls_title = "[投票管理]-请参与" + ls_tplb + "的投票";
string ls_body = "您投票的邀请码为:" + ls_yqm + "。<a href=" + ls_dburl + " target=\"_blank\">请点击进入投票页面!</a>";
String ls_sql = "insert into hyt_mail(ID,DOCID,hy_type,hy_foldername,hy_fsrid,hy_fsrname,hy_jsrid,hy_wbjsrid,hy_jsrname,hy_title,hy_body,hy_datetime,hy_ifsavetofjx,hy_yxj,hy_yjbg,hy_zycd,hy_hz,hy_wbjszh) values ";
ls_sql += "('" + Hyoa_global.GetRandom() + "','" + Hyoa_global.GetRandom() + "','收件','收件箱','admin','管理员','" + ls_jsrid + "','','" + ls_jsrname + "','" + ls_title + "','" + ls_body + "','" + System.DateTime.Now.ToString() + "','','','','','','') ";
db.Execute(ls_sql);
//将邀请码
if (ls_yqmlists == "")
{
ls_yqmlists = ls_yqm;
}
else
{
ls_yqmlists = ls_yqmlists + "+" + ls_yqm;
}
}
}
}
else
{
string ls_jsrname = ls_cyr;
string[] lv_jsrname = ls_jsrname.Split('+');
for (var i = 0; i < lv_jsrname.Length; i++)
{
if (lv_jsrname[i] != "")
{
string ls_jsrid = "";
string sqluser = "select * from hyt_user where hy_username='" + lv_jsrname[i] + "'";
DataTable dtuser = db.GetDataTable(sqluser);
if (dtuser.Rows.Count > 0)
{
ls_jsrid = dtuser.Rows[0]["hy_userid"].ToString();
}
string ls_yqm = "";
string ls_yqms = GetRandom3();
if (lv_jsrname[i] == "管理员")
{
ls_yqm = "000" + ls_yqms;
}
else
{
//Response.Write("<script>alert('" + ls_jsrid + "')</script>");
//return;
if (ls_jsrid != "" && ls_jsrid.Length - 3 > 0)
{
ls_yqm = ls_jsrid.Substring(ls_jsrid.Length - 3) + ls_yqms; //获得6位数字的随机数
}
}
////发送待办
//string ls_dburl = "wstp.aspx?rnd=" + Hyoa_global.GetRandom();
//string ls_body = this.Session["hyuname"].ToString() + "发起投票,请您参与";
//Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_jsrid[i].ToString(), lv_jsrname[i].ToString(),
// this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), ls_dburl, "待办", this.hy_mudelid.Text, "待办箱", "一般", ls_body, "请参与", 0, "", "");
//给参与的人发送邮件
//string ls_dburl = "/wstp.aspx?yqm=" + ls_yqm + "&rnd=" + Hyoa_global.GetRandom();
string ls_dburl = "/wstp.aspx?rnd=" + Hyoa_global.GetRandom();
string ls_title = "[投票管理]-请参与" + ls_tplb + "的投票";
string ls_body = "您投票的邀请码为:" + ls_yqm + "。<a href=" + ls_dburl + " target=\"_blank\">请点击进入投票页面!</a>";
String ls_sql = "insert into hyt_mail(ID,DOCID,hy_type,hy_foldername,hy_fsrid,hy_fsrname,hy_jsrid,hy_wbjsrid,hy_jsrname,hy_title,hy_body,hy_datetime,hy_ifsavetofjx,hy_yxj,hy_yjbg,hy_zycd,hy_hz,hy_wbjszh) values ";
ls_sql += "('" + Hyoa_global.GetRandom() + "','" + Hyoa_global.GetRandom() + "','收件','收件箱','admin','管理员','" + ls_jsrid + "','','" + lv_jsrname[i].ToString() + "','" + ls_title + "','" + ls_body + "','" + System.DateTime.Now.ToString() + "','','','','','','') ";
db.Execute(ls_sql);
//将邀请码
if (ls_yqmlists == "")
{
ls_yqmlists = ls_yqm;
}
else
{
ls_yqmlists = ls_yqmlists + "+" + ls_yqm;
}
}
}
}
//更新表
string sql = "update hyp_flowmain set hy_field30='" + ls_yqmlists + "',hy_field100=1 where hy_field20='" + ls_tplb + "'";
db.Execute(sql);
db.Close();
db.Dispose();
this.txtuids.Value = "";
//DataPlay(System.Int32.Parse(this.curpage.Text));
Response.Write("<script>alert('发布投票成功!');window.location = '/list_tpgl.aspx?mid=moduletpgl&tableid=bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd';</script>");
}