本文整理汇总了C#中HyoaClass.Hyoa_global.GetDataTable_USER方法的典型用法代码示例。如果您正苦于以下问题:C# HyoaClass.Hyoa_global.GetDataTable_USER方法的具体用法?C# HyoaClass.Hyoa_global.GetDataTable_USER怎么用?C# HyoaClass.Hyoa_global.GetDataTable_USER使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HyoaClass.Hyoa_global
的用法示例。
在下文中一共展示了HyoaClass.Hyoa_global.GetDataTable_USER方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
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);
}
示例2: Button_Save_Click
//查询
protected void Button_Save_Click(object sender, EventArgs e)
{
string ls_return = "";
if (txtsql.Value == "")
{
ls_return = "请填写查询语句";
}
if (ddldbconn.SelectedValue == "")
{
ls_return = "请选择连接";
}
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
DataTable dt = new DataTable();
if (ddldbconn.SelectedValue == "base")
{
dt = Hyoa_global.GetDataTable_BASE(txtsql.Value);
}
if (ddldbconn.SelectedValue == "pro")
{
dt = Hyoa_global.GetDataTable(txtsql.Value);
}
if (ddldbconn.SelectedValue == "user")
{
dt = Hyoa_global.GetDataTable_USER(txtsql.Value);
}
if (dt.Rows.Count > 0)
{
ls_return += "<table border=1 width='100%'>";
ls_return += "<tr>";
for (int j = 0; j < dt.Columns.Count; j++)
{
ls_return += "<td>" + dt.Columns[j].ToString() + "</td>";
}
ls_return += "</tr>";
for (int i = 0; i < dt.Rows.Count; i++)
{
ls_return += "<tr>";
for (int j = 0; j < dt.Columns.Count; j++)
{
ls_return += "<td>"+dt.Rows[i][dt.Columns[j].ToString()].ToString()+"</td>";
}
ls_return += "</tr>";
}
ls_return += "</table>";
}
lbljg.Text = ls_return;
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (this.Session["hyuid"].ToString() == "")
this.Response.Redirect("login.aspx");
if (!IsPostBack)
{
//给下拉框赋值 客户经理
string sqlSelect = " SELECT hy_username FROM hyt_user WHERE (hy_deptid LIKE '005%') OR (hy_deptid LIKE '006%') ";
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
DataTable dt = Hyoa_global.GetDataTable_USER(sqlSelect);
ddl_khjl.DataSource = dt;
ddl_khjl.DataTextField = "hy_username";
ddl_khjl.DataValueField = "hy_username";
ddl_khjl.DataBind();
ddl_khjl.Items.Insert(0, new ListItem("--请选择--", ""));
this.ddl_khjl.SelectedIndex = 0;
}
}
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string lsid = "";
if (this.Request.QueryString["id"] != null)
{
lsid = this.Request.QueryString["id"].ToString();
}
HyoaClass.Hyoa_global db = new HyoaClass.Hyoa_global();
string lssql1 = "SELECT hy_userid,hy_username FROM hyt_user WHERE hy_deptid = '" + lsid + "' ORDER BY hy_sort ";
DataTable dt1 = db.GetDataTable_USER(lssql1);
string lsstr1 = "", lsstr2 = "";
if (dt1.Rows.Count > 0)
{
for (int i = 0; i < dt1.Rows.Count; i++)
{
if (lsstr1 == "")
{
lsstr1 = dt1.Rows[i]["hy_userid"].ToString();
}
else
{
lsstr1 = lsstr1 + "," + dt1.Rows[i]["hy_userid"].ToString();
}
if (lsstr2 == "")
{
lsstr2 = dt1.Rows[i]["hy_username"].ToString();
}
else
{
lsstr2 = lsstr2 + "," + dt1.Rows[i]["hy_username"].ToString();
}
}
}
this.Response.Write(lsstr2 + "|" + lsstr1);
//return ;
}
示例5: DataPlay
private void DataPlay()
{
//label清空
int count = 1;
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
string sqlSelect = " select hyc_gzzq from hyc_Tablezbgl where 1=1 ";
if (this.txt_tjz_s.Value != "")
{
sqlSelect += " and hy_djsj >= '" + this.txt_tjz_s.Value + "' ";
}
if (this.txt_tjz_e.Value != "")
{
sqlSelect += " and hy_djsj <='" + this.txt_tjz_e.Value + "' ";
}
sqlSelect += " GROUP BY hyc_gzzq ";
DataTable dt = Hyoa_global.GetDataTable(sqlSelect);
DataTable dt3;
if(dt.Rows.Count>0)
{
sqlSelect = " select hy_userid,hy_username from hyt_user ";
DataTable dt2 = Hyoa_global.GetDataTable_USER(sqlSelect);
for(int j=0;j<dt.Rows.Count;j++)
{
if(dt2.Rows.Count>0)
{
for (int i = 0; i < dt2.Rows.Count;i++ )
{
sqlSelect = " select * from hyc_Tablezbgl where 1=1 and hyc_gzzq='" + dt.Rows[j]["hyc_gzzq"].ToString() + "' and hy_djrid='" + dt2.Rows[i]["hy_userid"].ToString() + "' ";
dt3 = Hyoa_global.GetDataTable(sqlSelect);
if(dt3.Rows.Count==0)
{
Total++;
lb_show.Text += " <tr height=\"35px\"><td width=\"5%\" class=\"TdcellHead\"><p align=\"center\">" + Total + "</p></td>";
lb_show.Text += "<td width=\"25%\" class=\"TdcellHead\"><p align=\"center\">第" + dt.Rows[j]["hyc_gzzq"].ToString() + "周</p></td>";
lb_show.Text += " <td width=\"30%\" class=\"TdcellHead\"><p align=\"center\"> " + dt2.Rows[i]["hy_username"].ToString() + "</p> </td>";
}
}
}
}
}
}
示例6: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if(Request.QueryString["key"]!=null)
{
string ls_key = "";
ls_key = Request.QueryString["key"].ToString();
DataTable dt;
string sql = "select * from hyt_user where hy_userid like '%" + ls_key + "%'";
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
dt = Hyoa_global.GetDataTable_USER(sql);
string ls_name = "";
this.Response.Write("<div align=left id=sampleLayer style=\"position:absolute; top:130px; left:240px; width:250px; height:100px; background:#EEEEEE; overflow:scroll; border: 1px solid #919191; font-family:Verdana; font-size:8pt\">");
for (int i = 0; i < dt.Rows.Count; i++)
{
ls_name = ls_name + dt.Rows[i]["hy_userid"].ToString();
this.Response.Write("<li><a href=\"#\" onclick=\"if(document.forms[0].txthy_jsrname.value==''){document.forms[0].txthy_jsrname.value='" + dt.Rows[i]["hy_username"].ToString() + "';document.forms[0].txthy_jsrid.value='" + dt.Rows[i]["hy_userid"].ToString() + "';}else{document.forms[0].txthy_jsrname.value=document.forms[0].txthy_jsrname.value+'+" + dt.Rows[i]["hy_username"].ToString() + "';document.forms[0].txthy_jsrid.value=document.forms[0].txthy_jsrid.value+'+" + dt.Rows[i]["hy_userid"].ToString() + "';} document.all('sampleLayer').style.visibility='hidden'; \">" + dt.Rows[i]["hy_username"].ToString() + "</a></li>");
}
this.Response.Write("</div>");
return;
}
}
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if(Request.QueryString["key"]!=null)
{
string ls_key = Request.QueryString["key"].ToString();
string ls_ret1 = "", ls_ret2 = "";
if (Request.QueryString["ret1"] != null)
{
ls_ret1 = Request.QueryString["ret1"].ToString();
}
if (Request.QueryString["ret2"] != null)
{
ls_ret2 = Request.QueryString["ret2"].ToString();
}
string sql = "select * from hyt_user where hy_userid like '%" + ls_key + "%'";
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
DataTable dt = Hyoa_global.GetDataTable_USER(sql);
this.Response.Write("<div align=left id=sampleLayer style=\" z-index: 999;position:absolute; width:260px; height:180px; overflow-y:scroll; font-family:Verdana; font-size:10pt; line-height:22px;\">");
for (int i = 0; i < dt.Rows.Count; i++)
{
string ls_id = dt.Rows[i]["hy_userid"].ToString();
string ls_name = dt.Rows[i]["hy_username"].ToString();
this.Response.Write("<li><a href=\"#\" onclick=\"if(window.parent.document.getElementById('" + ls_ret2 + "').value==''){ ");
this.Response.Write("window.parent.document.getElementById('" + ls_ret2 + "').value='" + ls_name + "'; ");
this.Response.Write("window.parent.document.getElementById('" + ls_ret1 + "').value='" + ls_id + "';}else{ ");
this.Response.Write("window.parent.document.getElementById('" + ls_ret2 + "').value=window.parent.document.getElementById('" + ls_ret2 + "').value+'+" + ls_name + "'; ");
this.Response.Write("window.parent.document.getElementById('" + ls_ret1 + "').value=window.parent.document.getElementById('" + ls_ret1 + "').value+'+" + ls_id + "';}");
this.Response.Write("window.parent.document.getElementById('divProvince').style.display='none';");
this.Response.Write("\"> " + ls_name + "</a></li>");
}
this.Response.Write("</div>");
return;
}
}
示例8: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
//根据用于id得到中文名
string lsuserid = "", lsoutput = "", sqlSelect = "";
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
if (this.Request.QueryString["userid"] != null)
lsuserid = this.Request.QueryString["userid"].ToString();
if (lsuserid != "")
{
sqlSelect = " select hy_username from hyt_user where hy_userid = '" + lsuserid + "' ";
DataTable dt = Hyoa_global.GetDataTable_USER(sqlSelect);
if (dt.Rows.Count > 0)
{
lsoutput = dt.Rows[0]["hy_username"].ToString();
}
else
{
lsoutput = "";
}
}
Response.Write(lsoutput);
}
示例9: Page_Load
//.........这里部分代码省略.........
string ls_field = "";
string ls_checklen = "0";
string ls_field_bz = "";
if (this.Request.QueryString["op"] != null)
{
ls_op = this.Request.QueryString["op"].ToString(); //传入选项方式:sgpz(手工配置)、sql(语句sql)
}
if (this.Request.QueryString["key"] != null)
{
ls_key = this.Request.QueryString["key"].ToString(); //选项内容
}
if (this.Request.QueryString["type"] != null)
{
ls_type = this.Request.QueryString["type"].ToString(); //类型:单选、多选、关键字检索时为sql
}
if (this.Request.QueryString["field"] != null)
{
ls_field = this.Request.QueryString["field"].ToString(); //传回数据的域
}
if (this.Request.QueryString["checklen"] != null)
{
ls_checklen = this.Request.QueryString["checklen"].ToString(); //选中个数
}
if (this.Request.QueryString["field_bz"] != null)
{
ls_field_bz = this.Request.QueryString["field_bz"].ToString(); //备注
}
if (ls_op == "sql")
{
//读取sql
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
DataTable dt = new DataTable();
dt = Hyoa_global.GetDataTable_USER(ls_key);
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
string ls_v = dt.Rows[i][0].ToString();
if (ls_type == "rediotype")
{
this.Response.Write(" <input onclick=\"js_hy_redio()\" type=\"radio\" id=\"hy_redio_" + i + "\" name=\"hy_redio\" value=\"" + ls_v + "\" /><label for=\"hy_redio_" + i + "\">" + ls_v + " </label><br/>");
}
else if (ls_type == "checkedtype")
{
this.Response.Write(" <input onclick=\"js_hy_checked()\" type=\"checkbox\" id=\"hy_checkbox_" + i + "\" name=\"hy_checkbox\" value=\"" + ls_v + "\" /><label for=\"hy_checkbox_" + i + "\">" + ls_v + " </label><br/>");
}
}
}
}
else if (ls_op == "sgpz")
{
//读取自定义字符串,如:张三|李四|王五|刘六
string[] lv_key = ls_key.Split('|');
for (int i = 0; i < lv_key.Length; i++)
{
string ls_v = lv_key[i];
if (ls_type == "rediotype")
{
this.Response.Write(" <input onclick=\"js_hy_redio()\" type=\"radio\" id=\"hy_redio_" + i + "\" name=\"hy_redio\" value=\"" + ls_v + "\" /><label for=\"hy_redio_" + i + "\">" + ls_v + " </label><br/>");
}
else if (ls_type == "checkedtype")
{
this.Response.Write(" <input onclick=\"js_hy_checked()\" type=\"checkbox\" id=\"hy_checkbox_" + i + "\" name=\"hy_checkbox\" value=\"" + ls_v + "\" /><label for=\"hy_checkbox_" + i + "\">" + ls_v + " </label><br/>");
}
示例10: btnDRToSQL_Click
//fy20130801 导入功能
protected void btnDRToSQL_Click(object sender, EventArgs e)
{
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
//链接SQL数据库
if (FileUpload1.HasFile == false) //HasFile用来检查FileUpload是否有指定文件
{
Response.Write("<script>alert('请您选择Excel文件')</script> ");
return; //当无文件时,返回
}
string IsXls = System.IO.Path.GetExtension(FileUpload1.FileName).ToString().ToLower(); //System.IO.Path.GetExtension获得文件的扩展名
if (IsXls != ".xls" && IsXls != ".xlsx")
{
Response.Write("<script>alert('只可以选择Excel文件')</script>");
return; //当选择的不是Excel文件时,返回
}
//根据年份判断在该路径下是否存在以当年年份文件夹 否则将建立以该年份的文件夹
string ls_ny = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
//HttpContext.Current.Server.MapPath(相对路径):把相对路径转为服务器上的绝对路径。File.Exists(绝对路径):检查是否存在绝对路径指向的文件或目录。
if (!Directory.Exists(HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny))
{
//System.IO.Directory.CreateDirectory(文件夹绝对路径):建立绝对路径文件夹。
System.IO.Directory.CreateDirectory(@HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny);
}
string filename = DateTime.Now.ToString("hhMMss") + FileUpload1.FileName; //重新为文件命名,获取Execle文件名 DateTime日期函数
// 保存文件到路径,用Server.MapPath()取当前文件的绝对目录.在asp.net里""必须用"\"代替
string savePath = Server.MapPath(("~\\upload/" + ls_ny + "\\") + filename);//Server.MapPath 获得虚拟服务器相对路径
FileUpload1.SaveAs(savePath); //SaveAs 将上传的文件内容保存在服务器上
DataSet ds = ExecleDs(savePath, filename); //调用自定义方法
DataRow[] dr = ds.Tables[0].Select(); //定义一个DataRow数组
int rowsnum = ds.Tables[0].Rows.Count;
int i_into = 0;
string sqlInsert = "";
string strDocid = "";
string sqlSelect = "";
string strUserid = "";
string strUserDeptid = "";
string strUserDeptName = "";
string strYwxf = "";
string strZcl = "";
if (rowsnum == 0)
{
Response.Write("<script>alert('Excel表为空表,无数据!')</script>"); //当Excel表为空时,对用户进行提示
}
else
{
for (int i = 0; i < dr.Length; i++)
{
/*
导入整体思路:数据来自一个excel表,导入的时候先导主表,后导字表。主表按照常规来导,指定哪些字段导入到数据库中,字表依据主表的docid作为父id,
* 进行导入,导入之前先判断是excel表中有没有数据,如果有数据,而且不是一些特定的不需要导入的数据,就导入
*/
sqlSelect = " select u.hy_userid,d.hy_deptid,d.hy_deptname from hyt_user u join hyt_dept d on u.hy_deptid=d.hy_deptid where u.hy_username='" + dr[i][0].ToString() + "' ";
DataTable dt = Hyoa_global.GetDataTable_USER(sqlSelect);
if (dt.Rows.Count > 0)
{
strUserid = dt.Rows[0]["hy_userid"].ToString();
strUserDeptid = dt.Rows[0]["hy_deptid"].ToString();
strUserDeptName = dt.Rows[0]["hy_deptname"].ToString();
}
else
{
Response.Write("<script>alert('这条数据导错了" + i_into + dr[i][0].ToString() + "');</script>");
Response.Write(sqlSelect);
return;
}
strDocid = System.Guid.NewGuid().ToString();
//导入主表
sqlInsert = " insert into hyc_Tablefpbd( DOCID,hy_bt,hy_clrylist,hy_curclrid,hy_curclrname,hy_curtacheid";
sqlInsert += " ,hy_curtachename,hy_cyrylist,hy_djrbmid,hy_djrbmname,hy_djrid,hy_djrname,hy_djsj";
sqlInsert += " ,hy_flowid,hy_flowname,hy_ifconfirm,hy_iftx,hy_motherid,hy_mudelid,hy_readdatelist";
sqlInsert += " ,hy_readuserlist,hy_tableid,hy_zhtxsj,hyc_bxje,hyc_bxjedx,hyc_djr,hyc_djsj";
sqlInsert += " ,hyc_djz,hyc_fatherid,hyc_fplx,hyc_fplxx,hyc_cpmc1,hyc_fptt,hyc_htkp,hyc_kpsj";
sqlInsert += " ,hyc_muild,hyc_sfbf,hyc_skrq,hyc_tableid,hyc_yf) values ( '" + strDocid + "','',''";
sqlInsert += " ,'" + strUserid + "','" + dr[i][0].ToString() + "','**','流程已结束','," + strUserid + ",'";
sqlInsert += " ,'" + strUserDeptid + "','" + strUserDeptName + "','" + strUserid + "','" + dr[i][0].ToString() + "',getdate(),'Flowfp','发票管理'";
sqlInsert += " ,'','','','Mudelfp','',''";
sqlInsert += " ,'Tablefpbd','','" + dr[i][53].ToString() + "','','" + dr[i][0].ToString() + "',getdate(),'" + strUserDeptName + "'";
sqlInsert += " ,'','" + dr[i][2].ToString() + "','普通增值税发票','" + dr[i][3].ToString() + "','" + dr[i][1].ToString() + "','否','" + dr[i][54].ToString() + "'";
sqlInsert += " ,'','','" + dr[i][55].ToString() + "','','') ";
Hyoa_global.ExcuteSQL(sqlInsert);
//开始导字表
for (int j = 4; j < 57; j++)
{
if (dr[i][j].ToString() != "" && (j != 5 || j != 7 || j != 9) && dr[i][j].ToString() != "0")
{
strYwxf = getChildTable(j);
if (strYwxf != "")
{
//先将“增量”这两个字去掉
if (strYwxf.Contains("增量"))
{
//将“增量”特定的给一个字符串
strZcl = "增量";
strYwxf = strYwxf.Replace("增量", "");
//.........这里部分代码省略.........
示例11: remindDBSY
//客户生日待办事宜 add by zxx 20150327
private void remindDBSY(string lsTableid, string lsCondition, string lsRemind, string lsRemindField)
{
DateTime time_Now = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd"));
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
string sqlSelect = " select * from hyc_" + lsTableid + " ";
string sqlSelectDBSY = "";
DataTable dt = Hyoa_global.GetDataTable(sqlSelect);
string sqlSelect_RY = "";
DataTable dt_ryid = new DataTable();
string str_btxrid = "";
try{
if (dt.Rows.Count > 0)
{
//存在
for (int i = 0; i < dt.Rows.Count; i++)
{
sqlSelect_RY = " select * from hyt_user where hy_username='" + dt.Rows[i]["hyc_" + lsRemindField + ""].ToString() + "'";
dt_ryid = Hyoa_global.GetDataTable_USER(sqlSelect_RY);
if (dt_ryid.Rows.Count > 0)
{
str_btxrid = dt_ryid.Rows[0]["hy_userid"].ToString();
}
else
{
str_btxrid = dt.Rows[i]["hy_djrid"].ToString();
}
if (dt.Rows[i]["hyc_" + lsCondition + ""].ToString() != "")
{
sqlSelectDBSY = " select id from hyt_dbsy where docid ='" + dt.Rows[i]["docid"].ToString() + "'";
DataTable dt2 = Hyoa_global.GetDataTable(sqlSelectDBSY);
DateTime txsj = Convert.ToDateTime(dt.Rows[i]["hyc_" + lsCondition + ""].ToString());
if (time_Now < txsj)
{
//当前时间小于提醒时间
}
else if (time_Now == txsj)
{
//当前时间等于提醒时间
if (dt2.Rows.Count > 0)
{
//待办事宜中有数据 update
string sqlUpdate = " update hyt_dbsy set hy_property='待办',hy_foldername='待办箱',hy_ifyb='0' where ID='" + dt2.Rows[0]["ID"].ToString() + "'";
Hyoa_global.ExcuteSQL(sqlUpdate);
}
else
{
//待办事宜中无数据 insert
sqlSelect = "insert into hyt_dbsy(ID,DOCID,hy_dbrid,hy_dbrname,hy_fsrid,hy_fsrname,hy_createtime,hy_url,";
sqlSelect += "hy_property,hy_mudelid,hy_foldername,hy_hj,hy_bt,hy_subbt,hy_ifyb,hy_flowid,hy_tacheid,hy_tableid) values ";
sqlSelect += "('" + System.Guid.NewGuid().ToString() + "','" + dt.Rows[i]["docid"].ToString() + "','" + dt.Rows[i]["hy_djrid"].ToString() + "',";
sqlSelect += " '" + dt.Rows[i]["hy_djrname"].ToString() + "','" + str_btxrid + "','" + dt.Rows[i]["hyc_" + lsRemindField + ""].ToString() + "',";
sqlSelect += " '" + DateTime.Now.ToString("yyyy-MM-dd") + "','main_flc.aspx?op=modify&mid=" + dt.Rows[i]["hy_mudelid"].ToString() + "&tableid=" + dt.Rows[i]["hy_tableid"].ToString() + "&docid=" + dt.Rows[i]["DOCID"].ToString() + "&pop=1',";
sqlSelect += " '待办','" + dt.Rows[i]["hy_mudelid"].ToString() + "','待办箱','一般','" + lsRemind + "','请办理','0','','','" + dt.Rows[i]["hy_tableid"].ToString() + "') ";
Hyoa_global.ExcuteSQL(sqlSelect);
}
}
else
{
//当前时间大于提醒时间
if (dt2.Rows.Count > 0)
{
//待办事宜中有数据 update
string sqlUpdate = " update hyt_dbsy set hy_property='已办',hy_foldername='待办箱',hy_ifyb='1' where ID='" + dt2.Rows[0]["ID"].ToString() + "'";
Hyoa_global.ExcuteSQL(sqlUpdate);
}
}
}
}
}
}catch(Exception ex){
}
}
示例12: GetNames
//添加姓名
private void GetNames()
{
string sql_Name = "select * from hyt_user";
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
DataTable dt = Hyoa_global.GetDataTable_USER(sql_Name);
DataView dv = new DataView(dt);
list_xm.DataSource = dv;
list_xm.DataValueField = "hy_username";
list_xm.DataTextField = "hy_username";
list_xm.DataBind();
list_xm.Items.Insert(0, new ListItem("--请选择--"));
}
示例13: btnDRToSQL_Click
//fy20130801 导入功能
protected void btnDRToSQL_Click(object sender, EventArgs e)
{
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
//链接SQL数据库
if (FileUpload1.HasFile == false) //HasFile用来检查FileUpload是否有指定文件
{
Response.Write("<script>alert('请您选择Excel文件')</script> ");
return; //当无文件时,返回
}
string IsXls = System.IO.Path.GetExtension(FileUpload1.FileName).ToString().ToLower(); //System.IO.Path.GetExtension获得文件的扩展名
if (IsXls != ".xls" && IsXls != ".xlsx")
{
Response.Write("<script>alert('只可以选择Excel文件')</script>");
return; //当选择的不是Excel文件时,返回
}
//根据年份判断在该路径下是否存在以当年年份文件夹 否则将建立以该年份的文件夹
string ls_ny = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
//HttpContext.Current.Server.MapPath(相对路径):把相对路径转为服务器上的绝对路径。File.Exists(绝对路径):检查是否存在绝对路径指向的文件或目录。
if (!Directory.Exists(HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny))
{
//System.IO.Directory.CreateDirectory(文件夹绝对路径):建立绝对路径文件夹。
System.IO.Directory.CreateDirectory(@HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny);
}
string filename = DateTime.Now.ToString("hhMMss") + FileUpload1.FileName; //重新为文件命名,获取Execle文件名 DateTime日期函数
// 保存文件到路径,用Server.MapPath()取当前文件的绝对目录.在asp.net里""必须用"\"代替
string savePath = Server.MapPath(("~\\upload/" + ls_ny + "\\") + filename);//Server.MapPath 获得虚拟服务器相对路径
FileUpload1.SaveAs(savePath); //SaveAs 将上传的文件内容保存在服务器上
DataSet ds = ExecleDs(savePath, filename); //调用自定义方法
DataRow[] dr = ds.Tables[0].Select(); //定义一个DataRow数组
int rowsnum = ds.Tables[0].Rows.Count;
int i_into = 0;
string sqlSelect = "";
string strUserid = "";
string strUdeptid = "";
string strUdeptname = "";
string sqlInsert = "";
if (rowsnum == 0)
{
Response.Write("<script>alert('Excel表为空表,无数据!')</script>"); //当Excel表为空时,对用户进行提示
}
else
{
for (int i = 0; i < dr.Length; i++)
{
sqlSelect=" select u.hy_userid,u.hy_deptid,d.hy_deptname from hyt_user u join hyt_dept d on u.hy_deptid=d.hy_deptid where u.hy_username='"+dr[i]["责任人"].ToString()+"' ";
DataTable dt = Hyoa_global.GetDataTable_USER(sqlSelect);
if (dt.Rows.Count > 0)
{
strUserid = dt.Rows[0]["hy_userid"].ToString();
strUdeptid = dt.Rows[0]["hy_deptid"].ToString();
strUdeptname = dt.Rows[0]["hy_deptname"].ToString();
}
sqlInsert = " insert into hyc_Tablekhda( DOCID,hy_djrbmid,hy_djrbmname,hy_djrid,hy_djrname,hy_djsj";
sqlInsert += " ,hy_mudelid,hy_tableid,hyc_bgsdh,hyc_bz,hyc_dwdz,hyc_dwmc";
sqlInsert += " ,hyc_dzyx,hyc_hyfl,hyc_jtzz,hyc_khjl,hyc_lsm,hyc_lxr,hyc_qq,hyc_qt,hyc_sj,hyc_sqjs";
sqlInsert += " ,hyc_sr,hyc_ssqy,hyc_szbm,hyc_whjb,hyc_whjb2,hyc_wx,hyc_xb,hyc_xzbm";
sqlInsert += " ,hyc_zrr,hyc_zw,hyc_zzdh) values ( '"+System.Guid.NewGuid().ToString()+"','"+strUdeptid+"',";
sqlInsert+=" '"+strUdeptname+"','"+strUserid+"','"+dr[i]["责任人"].ToString()+"',getdate(),'Mudelkhda'";
sqlInsert += " ,'Tablekhda','"+dr[i]["办公室电话"].ToString()+"','"+dr[i]["备注"].ToString()+"','"+dr[i]["单位地址"].ToString()+"','"+dr[i]["单位名称"].ToString()+"','"+dr[i]["电子邮箱"].ToString()+"'";
sqlInsert += " ,'"+dr[i]["行业分类"].ToString()+"','"+dr[i]["家庭住址"].ToString()+"','"+dr[i]["业务类型"].ToString()+"','"+dr[i]["连锁名/门店名/曾用名"].ToString()+"','"+dr[i]["第一联系人姓名"].ToString()+"','"+dr[i]["QQ"].ToString()+"','"+dr[i]["其他"].ToString()+"','"+dr[i]["其他"].ToString()+"'";
sqlInsert += " ,'"+dr[i]["售前技术工程师"].ToString()+"','"+dr[i]["生日"].ToString()+"','"+dr[i]["所属区域"].ToString()+"','"+dr[i]["所在部门"].ToString()+"','"+dr[i]["客户类型"].ToString()+"','"+dr[i]["维护级别"].ToString()+"','"+dr[i]["微信"].ToString()+"'";
sqlInsert += " ,'"+dr[i]["性别"].ToString()+"','"+dr[i]["协助部门/协助人"].ToString()+"','"+dr[i]["责任人"].ToString()+"','"+dr[i]["职位"].ToString()+"','"+dr[i]["住宅电话"].ToString()+"') ";
if (!Hyoa_global.ExcuteSQL(sqlInsert))
{
Response.Write(sqlInsert);
return;
}
}
Response.Write("<script>alert('导入成功!');</script>");
}
}
示例14: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string ls_flowid;
string ls_nexttacheid;
string ls_deptid;
string ls_username;
string ls_userid;
string ls_opt;
ls_flowid = "";
ls_nexttacheid = "";
ls_deptid = "";
ls_username = "";
ls_userid = "";
ls_opt = "";
if (this.Request.QueryString["flowid"] != null)
{
ls_flowid = this.Request.QueryString["flowid"].ToString();
}
if (this.Request.QueryString["nexttacheid"] != null)
{
ls_nexttacheid = this.Request.QueryString["nexttacheid"].ToString();
}
if (this.Request.QueryString["deptid"] != null)
{
ls_deptid = this.Request.QueryString["deptid"].ToString();
}
if (this.Request.QueryString["opt"] != null)
{
ls_opt = this.Request.QueryString["opt"].ToString();
}
//如果opt等于clr,则表示处理人的域,如果opt等于cyr,则表示传阅人的域
if (ls_opt == "clr")
{
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
//后序环节处理人员
HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
//先得到后续环节处理人集合
DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(ls_flowid, ls_nexttacheid);
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 = "";
if (ls_deptid == "--请选择--")
{
if (Session["conntype"].ToString() == "SQL")
{
sql = "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 = "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";
}
}
else
{
if (Session["conntype"].ToString() == "SQL")
{
sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + ls_deptid + "' order by a.hy_deptsort,b.hy_sort";
}
if (Session["conntype"].ToString() == "ORACLE")
{
sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + ls_deptid + "' order by a.hy_deptsort,b.hy_sort";
}
}
DataTable dt = Hyoa_global.GetDataTable_USER(sql);
if (dt.Rows.Count > 0)
{
ls_temp1 = "";
for (int i = 0; i < dt.Rows.Count; i++)
{
if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
{
}
else
{
//开始输出
if (ls_username == "")
{
ls_username = dt.Rows[i]["hy_username"].ToString();
ls_userid = dt.Rows[i]["hy_userid"].ToString();
}
else
{
ls_username += "+" + dt.Rows[i]["hy_username"].ToString();
ls_userid += "+" + dt.Rows[i]["hy_userid"].ToString();
}
ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
}
}
}
}
this.Response.Write(ls_username + "*" + ls_userid);
return ;
}
//.........这里部分代码省略.........
示例15: Hy_nexttachename_SelectedIndexChanged
protected void Hy_nexttachename_SelectedIndexChanged(object sender, EventArgs e)
{
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
//后序环节处理人部门
HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
DataTable dt = new DataTable();
//先清空
this.Hy_deptlist_clr.DataSource = dt;
this.Hy_deptlist_clr.DataTextField = "hy_deptname";
this.Hy_deptlist_clr.DataValueField = "hy_deptid";
this.Hy_deptlist_clr.DataBind();
//先得到后续环节处理人集合
DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.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 = "";
if (Session["conntype"].ToString() == "SQL")
{
sql = "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 = "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";
}
dt = Hyoa_global.GetDataTable_USER(sql);
if (dt.Rows.Count > 0)
{
this.Hy_deptlist_clr.Items.Insert(0, "--请选择--");
ls_temp1 = "";
int t = 1;
for (int i = 0; i < dt.Rows.Count; i++)
{
if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_deptid"].ToString() + ","))
{
}
else
{
//解决多级部门后续提交时部门显示的问题 added by xf 20131226
string ls_deptname = "";
if (dt.Rows[i]["hy_deptid"].ToString().Length == 3)
{
ls_deptname = dt.Rows[i]["hy_deptname"].ToString();
}
else
{
ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString());
}
this.Hy_deptlist_clr.Items.Insert(t, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString()));
t += 1;
ls_temp1 += "," + dt.Rows[i]["hy_deptid"].ToString();
}
}
this.Hy_deptlist_clr.SelectedIndex = 0;
}
}
dt.Clear();
//后序环节传阅人员部门
//先清空
this.Hy_deptlist.DataSource = dt;
this.Hy_deptlist.DataTextField = "hy_deptname";
this.Hy_deptlist.DataValueField = "hy_deptid";
this.Hy_deptlist.DataBind();
HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
dt = Hyoa_dept.Getdepts();
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
//解决多级部门后续提交时部门显示的问题 added by xf 20131226
string ls_deptname = "";
if (dt.Rows[i]["hy_deptid"].ToString().Length == 3)
{
ls_deptname = dt.Rows[i]["hy_deptname"].ToString();
}
else
{
ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString());
}
this.Hy_deptlist.Items.Insert(i, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString()));
}
this.Hy_deptlist.SelectedIndex = 0;
}
dt.Clear();
//后序环节处理人员
//先得到后续环节处理人集合
//先清空
this.Hy_hjclr.DataSource = dt;
this.Hy_hjclr.DataTextField = "hy_username";
this.Hy_hjclr.DataValueField = "hy_userid";
this.Hy_hjclr.DataBind();
dt_nextflowuser.Clear();
dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
if (dt_nextflowuser.Rows.Count > 0)
{
//.........这里部分代码省略.........