本文整理汇总了C#中HyoaClass.DAO.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# HyoaClass.DAO.Execute方法的具体用法?C# HyoaClass.DAO.Execute怎么用?C# HyoaClass.DAO.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HyoaClass.DAO
的用法示例。
在下文中一共展示了HyoaClass.DAO.Execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btndelinfo_Click
protected void btndelinfo_Click(object sender, EventArgs e)
{
HyoaClass.DAO db = new HyoaClass.DAO();
string sql = "";
String[] v_uids = this.txtuids.Value.Split(',');
for (int i = 0; i < v_uids.Length; i++)
{
if (v_uids[i] != "")
{
//删除当前记录
sql = "delete from hyk_whzx_tpgl where id='" + v_uids[i] + "'";
db.Execute(sql);
//删除投票选项表记录
sql = "delete from hyk_whzx_tpgl_tpxx where hy_tpztid='" + v_uids[i] + "'";
db.Execute(sql);
//删除投票明细记录
sql = "delete from hyk_whzx_tpgl_tpmx where hy_tpztid='" + v_uids[i] + "'";
db.Execute(sql);
}
}
this.txtuids.Value = "";
//DataPlay(1);
db.Close();
DataPlay(System.Int32.Parse(this.curpage.Text));
}
示例2: Button_Save_Click
//保存
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>");
}
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HyoaClass.DAO db = new HyoaClass.DAO();
String lssql = "";
for (int i = 0; i < 8000000; i++)
{
lssql = "insert into hyq_tb1_main (docid,hy_maindocid,hy_xm,hy_ytbrgx,hy_ytbrgx_bz) values ('" + i.ToString() + "','" + i.ToString() + "','" + i.ToString() + "','" + i.ToString() + "','" + i.ToString() +"')";
db.Execute(lssql);
}
this.Response.Write("插入完成!");
}
示例4: btndelinfo_Click
protected void btndelinfo_Click(object sender, EventArgs e)
{
HyoaClass.DAO db = new HyoaClass.DAO();
String[] v_uids = this.txtuids.Value.Split(',');
for (var i = 0; i < v_uids.Length; i++)
{
if (v_uids[i] != "")
{
string sql = "delete from hyt_searchconfig where ID='" + v_uids[i] + "'";
db.Execute(sql);
}
}
db.Close();
this.txtuids.Value = "";
//DataPlay(1);
DataPlay(System.Int32.Parse(this.curpage.Text));
}
示例5: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
//生成省侨办的用户及密码
HyoaClass.DAO db = new HyoaClass.DAO();
String lssql = "select * from hyt_user where 1=1 order by hy_userid";
DataTable dt = db.GetDataTable(lssql);
this.Response.Write("<table border='1'>");
Random Random1 = new Random();
int i1;
String lspassword = "";
String lssqlupdate = "";
for (int i = 0; i < dt.Rows.Count; i++)
{
this.Response.Write("<tr>");
this.Response.Write("<td>");
this.Response.Write("登录名");
this.Response.Write("</td>");
this.Response.Write("<td>");
this.Response.Write(dt.Rows[i]["hy_userid"].ToString());
this.Response.Write("</td>");
this.Response.Write("<td>");
this.Response.Write("中文名");
this.Response.Write("</td>");
this.Response.Write("<td>");
this.Response.Write(dt.Rows[i]["hy_username"].ToString());
this.Response.Write("</td>");
this.Response.Write("<td>");
this.Response.Write("密码");
this.Response.Write("</td>");
this.Response.Write("<td>");
i1 = Random1.Next(100000, 999999);
this.Response.Write(i1.ToString());
this.Response.Write("</td>");
this.Response.Write("</tr>");
lspassword = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(i1.ToString(), "MD5");
lssqlupdate = "update hyt_user set hy_pwd='" + lspassword + "' where hy_userid='" + dt.Rows[i]["hy_userid"].ToString() + "'";
db.Execute(lssqlupdate);
}
this.Response.Write("</table>");
}
示例6: btn_bh1_Click
//驳回
protected void btn_bh1_Click(object sender, EventArgs e)
{
//更新投票表
HyoaClass.DAO db = new HyoaClass.DAO();
string ls_sql = "update hyk_whzx_tpgl set hy_bhsj=getdate(),hy_gjzt='驳回投票' where id='" + this.txtdocid.Value + "'";
db.Execute(ls_sql);
db.Close();
//处理完成后的提示及跳转
string ls_tip = "投票驳回成功!";
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>");
}
}
示例7: btndelinfo_Click
protected void btndelinfo_Click(object sender, EventArgs e)
{
//HyoaClass.Hyoa_iplimit Hyoa_iplimit = new HyoaClass.Hyoa_iplimit();
HyoaClass.DAO db = new HyoaClass.DAO();
String[] v_uids = this.txtuids.Value.Split(',');
for (var i = 0; i < v_uids.Length; i++)
{
if (v_uids[i] != "")
{
//Hyoa_iplimit.ID = v_uids[i];
//Hyoa_iplimit.Delete();
string lssql = "delete from hyp_flowmain where hy_mudelid ='moduleqjzl' and hy_tableid='ac5e8ddd-d74c-4c9d-b0bf-5c23fc77b589' and DOCID='" + v_uids[i] + "'";
db.Execute(lssql);
}
}
this.txtuids.Value = "";
//DataPlay(1);
DataPlay(System.Int32.Parse(this.curpage.Text));
db.Close();
}
示例8: btn_add1_Click
//添加候选项
protected void btn_add1_Click(object sender, EventArgs e)
{
HyoaClass.DAO db = new HyoaClass.DAO();
string ls_sql = "";
int ls_sort = 1;
//通过问卷题目ID得到最大排序号
ls_sql = "select max(hy_sort) as hy_sort,count(*) as num from hyk_whzx_tpgl_tpxx where hy_tpztid='" + this.txtdocid.Value + "' order by hy_sort desc ";
DataTable dt = db.GetDataTable(ls_sql);
if (dt.Rows[0]["num"].ToString() != "0")
{
ls_sort = System.Int32.Parse(dt.Rows[0]["hy_sort"].ToString()) + 1;
}
dt.Clear();
ls_sql = "insert into hyk_whzx_tpgl_tpxx (id,hy_tpztid,hy_tpxxmc,hy_sort) values (";
ls_sql += "'" + System.Guid.NewGuid().ToString() + "','" + this.txtdocid.Value + "','" + this.hy_hxx.Value + "'," + ls_sort + "";
ls_sql += ")";
db.Execute(ls_sql);
savetj("准备投票");
//处理完成后的提示及跳转(增加刷新候选项功能)
Response.Write("<script>window.location='main_tpgl.aspx?op=modify&id=" + this.txtdocid.Value + "&url=" + this.txturl.Value + "'</script>");
}
示例9: Button_Save_Click
//保存
protected void Button_Save_Click(object sender, EventArgs e)
{
if (this.Session["hyuid"].ToString() == "")
this.Response.Redirect("/login.aspx");
string[] lvrow;
string[] lvcol;
lvrow = this.txtsubmit.Text.Split('*');
HyoaClass.DAO db = new HyoaClass.DAO();
DataTable dt;
string lssql = "";
string lssqlupdata = "";
string lssqlupdatapeo = "";
int lsvalue = 0;
for (int i = 0; i < lvrow.Length; i++)
{
lvcol = lvrow[i].Split('+');
lssql = "select * from hyp_flowmain where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'";
dt = db.GetDataTable(lssql);
//this.Response.Write("<script>alert('" + lvcol[1] + "');</script>");
if (dt.Rows[0]["hy_field1"].ToString() == lvcol[1])
{
if (dt.Rows[0]["hy_field11"].ToString() == "")
{
lsvalue = 1;
}
else
{
lsvalue = System.Int32.Parse(dt.Rows[0]["hy_field11"].ToString()) + 1;
}
//票数+1
lssqlupdata = "update hyp_flowmain set hy_field11=" + lsvalue.ToString() + " where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'";
db.Execute(lssqlupdata);
//记录投票人信息记录
lssqlupdatapeo = "update hyp_flowmain set hy_field7=hy_field7+'+" + this.Session["hyuname"].ToString() + "' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'";
db.Execute(lssqlupdatapeo);
}
if (dt.Rows[0]["hy_field2"].ToString() == lvcol[1])
{
if (dt.Rows[0]["hy_field12"].ToString() == "")
{
lsvalue = 1;
}
else
{
lsvalue = System.Int32.Parse(dt.Rows[0]["hy_field12"].ToString()) + 1;
}
lssqlupdata = "update hyp_flowmain set hy_field12=" + lsvalue.ToString() + " where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'";
db.Execute(lssqlupdata);
//记录投票人信息记录
lssqlupdatapeo = "update hyp_flowmain set hy_field8=hy_field8+'+" + this.Session["hyuname"].ToString() + "' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'";
db.Execute(lssqlupdatapeo);
}
if (dt.Rows[0]["hy_field3"].ToString() == lvcol[1])
{
if (dt.Rows[0]["hy_field13"].ToString() == "")
{
lsvalue = 1;
}
else
{
lsvalue = System.Int32.Parse(dt.Rows[0]["hy_field13"].ToString()) + 1;
}
lssqlupdata = "update hyp_flowmain set hy_field13=" + lsvalue.ToString() + " where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'";
db.Execute(lssqlupdata);
//记录投票人信息记录
lssqlupdatapeo = "update hyp_flowmain set hy_field9=hy_field9+'+" + this.Session["hyuname"].ToString() + "' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'";
db.Execute(lssqlupdatapeo);
}
if (dt.Rows[0]["hy_field4"].ToString() == lvcol[1])
{
if (dt.Rows[0]["hy_field14"].ToString() == "")
{
lsvalue = 1;
}
else
{
lsvalue = System.Int32.Parse(dt.Rows[0]["hy_field14"].ToString()) + 1;
}
lssqlupdata = "update hyp_flowmain set hy_field14=" + lsvalue.ToString() + " where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'";
db.Execute(lssqlupdata);
//记录投票人信息记录
lssqlupdatapeo = "update hyp_flowmain set hy_field17=hy_field17+'+" + this.Session["hyuname"].ToString() + "' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'";
db.Execute(lssqlupdatapeo);
}
if (dt.Rows[0]["hy_field5"].ToString() == lvcol[1])
{
if (dt.Rows[0]["hy_field15"].ToString() == "")
{
lsvalue = 1;
}
else
{
lsvalue = System.Int32.Parse(dt.Rows[0]["hy_field15"].ToString()) + 1;
}
lssqlupdata = "update hyp_flowmain set hy_field15=" + lsvalue.ToString() + " where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'";
db.Execute(lssqlupdata);
//记录投票人信息记录
lssqlupdatapeo = "update hyp_flowmain set hy_field18=hy_field18+'+" + this.Session["hyuname"].ToString() + "' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'";
//.........这里部分代码省略.........
示例10: btndcinfo_Click
protected void btndcinfo_Click(object sender, EventArgs e)
{
HyoaClass.DAO db = new HyoaClass.DAO();
String[] v_uids = this.txtuids.Value.Split(',');
for (var i = 0; i < v_uids.Length; i++)
{
if (v_uids[i] != "")
{
string ls_sql = "update hyp_flowmain set hy_field59='已导出' where DOCID = '" + v_uids[i] + "' ";
db.Execute(ls_sql);
}
}
this.txtuids.Value = "";
//DataPlay(1);
db.Close();
DataPlay(System.Int32.Parse(this.curpage.Text));
}
示例11: DataPlay
//.........这里部分代码省略.........
str.Append(" (已投" + ls_ytps + "票)");
str.Append("</div>");
dt3.Clear();
}
}
dt2.Clear();
this.hy_hxxR.Text = str.ToString();
if (dt.Rows[0]["hy_ktxx"].ToString() == "单选")
{
hy_rdi1.Checked = true;
}
else
{
hy_rdi2.Checked = true;
}
this.hy_ktxxR.Text = dt.Rows[0]["hy_ktxx"].ToString();
this.hy_kydz.Text = dt.Rows[0]["hy_ktpz"].ToString();
this.hy_kydzid.Value = dt.Rows[0]["hy_ktpzid"].ToString();
this.hy_kydzR.Text = dt.Rows[0]["hy_ktpz"].ToString();
this.hy_kcktpjg.Text = dt.Rows[0]["hy_kcktpjg"].ToString();
this.hy_kcktpjgid.Value = dt.Rows[0]["hy_kcktpjgid"].ToString();
this.hy_kcktpjgR.Text = dt.Rows[0]["hy_kcktpjg"].ToString();
//投票状态
this.txthy_gjzt.Value = dt.Rows[0]["hy_gjzt"].ToString();
//判断该投票是否已经过期==============
if (System.DateTime.Parse(dt.Rows[0]["hy_tpjssj"].ToString()).ToString("yyyy-MM-dd") != "1900-01-01" && Convert.ToDateTime(System.DateTime.Now.ToString("yyyy-MM-dd")) > Convert.ToDateTime(System.DateTime.Parse(dt.Rows[0]["hy_tpjssj"].ToString()).ToString("yyyy-MM-dd")))
{
//将该文档设为“结束投票”
string ls_sql = "update hyk_whzx_tpgl set hy_jssj=getdate(),hy_gjzt='结束投票' where id='" + this.txtdocid.Value + "'";
db.Execute(ls_sql);
//发送待办事宜给审阅人员
string ls_dburl = "/ekp/whzx/list_tpgl_tpjg.aspx?fid=" + this.txtdocid.Value + "&mid=" + this.txtmudelid.Value + "&pop=1";
string ls_body = "[" + this.hy_bt.Text + "]的投票已结束,请查看";
//部分可查看结果人员
string[] lv_kydzid = this.hy_kcktpjgid.Value.Split('+');
string[] lv_kydzname = this.hy_kcktpjgR.Text.Split('+');
for (int ii = 0; ii < lv_kydzid.Length; ii++)
{
Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_kydzid[ii], lv_kydzname[ii], this.txtdjrid.Value,
this.txtdjr.Value, ls_dburl, "待阅", this.txtmudelid.Value, "待办箱", "一般", ls_body, "请阅读", 0, "", "");
}
}
#endregion
}
dt.Clear();
//-----隐藏控制 s-------
//结果可以查看人员的权限
//Response.Write(this.hy_kcktpjgid.Value);
if (this.hy_kcktpjgid.Value.IndexOf(this.Session["hyuid"].ToString()) > 0)
{
this.btn_jg.Visible = true;
}
if (this.txtdjrid.Value == Session["hyuid"].ToString())
{
#region 如果当前用户是登记人员
示例12: DataPlay
//打开文档显示
private void DataPlay()
{
if (this.Request.QueryString["op"] != null)
{
HyoaClass.DAO db = new HyoaClass.DAO();
this.txtop.Value = this.Request.QueryString["op"].ToString(); //我要投票还是查看投票
this.txtdocid.Value = this.Request.QueryString["id"].ToString(); //文档ID
//我要投票
if (this.Request.QueryString["op"] == "add")
{
//判断是否已经投票过
string issql = "select * from hyk_whzx_tpgl_tpmx where hy_tpztid='" + this.txtdocid.Value + "' and hy_tprid ='" + Session["hyuid"].ToString() + "'";
DataTable isdt = db.GetDataTable(issql);
if (isdt.Rows.Count > 0)
{
Response.Write("<script>alert('您已经投票了!');window.location='list_tpgl_wytp.aspx'</script>");
}
//显示我要投票
this.btn_submit.Visible = true;
}
//根据id得到信息
string sql = "select * from hyk_whzx_tpgl where id='" + this.txtdocid.Value + "'";
DataTable dt = db.GetDataTable(sql);
if (dt.Rows.Count > 0)
{
#region 根据id得到信息
this.txtdjr.Value = dt.Rows[0]["hy_djr"].ToString();
this.txtdjrid.Value = dt.Rows[0]["hy_djrid"].ToString();
this.hy_lbl1.Text = System.DateTime.Parse(dt.Rows[0]["hy_djsj"].ToString()).ToString("yyyy-MM-dd");
this.hy_lbl2.Text = dt.Rows[0]["hy_tplb"].ToString();
this.hy_lbl3.Text = System.DateTime.Parse(dt.Rows[0]["hy_tpkssj"].ToString()).ToString("yyyy-MM-dd");
this.hy_lbl4.Text = System.DateTime.Parse(dt.Rows[0]["hy_tpjssj"].ToString()).ToString("yyyy-MM-dd");
this.hy_lbl5.Text = dt.Rows[0]["hy_xxsm"].ToString();
this.hy_lbl6.Text = dt.Rows[0]["hy_bt"].ToString();
//判断该投票是否已经过期
if (Convert.ToDateTime(System.DateTime.Now.ToString("yyyy-MM-dd")) > Convert.ToDateTime(this.hy_lbl4.Text))
{
//将该文档设为“结束投票”
string ls_sql = "update hyk_whzx_tpgl set hy_jssj=getdate(),hy_gjzt='结束投票' where id='" + this.txtdocid.Value + "'";
db.Execute(ls_sql);
Response.Write("<script>alert('对不起,该投票已经结束!');window.location='list_tpgl_wytp.aspx'</script>");
return;
}
//根据单选或多选得到选项
this.hy_tpfs.Value = dt.Rows[0]["hy_ktxx"].ToString(); //单选还是多选
string lssql = "select * from hyk_whzx_tpgl_tpxx where hy_tpztid='" + this.txtdocid.Value + "'";
DataTable dt2 = db.GetDataTable(lssql);
if (this.hy_tpfs.Value == "多选")
{
this.GridView1.Visible = false;
GridView2.DataSource = dt2;
GridView2.DataBind();
}
else
{
this.GridView2.Visible = false;
GridView1.DataSource = dt2;
GridView1.DataBind();
}
dt2.Clear();
#endregion
}
dt.Clear();
db.Close();
}
}
示例13: Button_Del_Click
//删除
protected void Button_Del_Click(object sender, EventArgs e)
{
HyoaClass.DAO db = new HyoaClass.DAO();
string lssql = "delete from hyp_flowmain where DOCID='" + this.txtdocid.Value + "'";
db.Execute(lssql);
string lssqldbsy = "delete from hyt_dbsy where DOCID='" + this.txtdocid.Value + "'";
db.Execute(lssqldbsy);
db.Close();
//处理完成后的提示及跳转(增加刷新附件功能)
string ls_tip = "删除成功!";
if (this.txtifpop.Value == "")
{
Response.Write("<script>window.location='" + this.txturl.Value + "'</script>");
}
else
{
Response.Write("<script>window.opener.location.reload();window.opener=null;window.open('','_self');window.close();</script>");
}
//效能办公日志记录
hyXnxtSaveLogs("", "删除一条记录", "删除");
}
示例14: dg1_UpdateCommand
private void dg1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string ls_ids = e.Item.Cells[0].Text;
string ls_sort = ((TextBox)e.Item.Cells[1].Controls[0]).Text;
string ls_hxx = ((TextBox)e.Item.Cells[2].Controls[0]).Text;
HyoaClass.DAO db = new HyoaClass.DAO();
string ls_sqlgx = "update hyk_whzx_tpgl_tpxx set hy_sort="+System.Int32.Parse(ls_sort)+", hy_tpxxmc='" + ls_hxx + "' where id ='" + ls_ids + "'";
db.Execute(ls_sqlgx);
dg1.EditItemIndex = -1;
this.DataBindHxx(); //重新协调绑定
}
示例15: Button_Pub_Click
//发布投票add by fy 2014-02-23
protected void Button_Pub_Click(object sender, EventArgs e)
{
//发布投票时发送邮件给参与投票人
HyoaClass.DAO db = new HyoaClass.DAO();
HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail();
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
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;
}
}
}
}
//更新表
//.........这里部分代码省略.........