本文整理汇总了C#中Estar.Business.DataManager.QueryDataRes.FillDataSet方法的典型用法代码示例。如果您正苦于以下问题:C# QueryDataRes.FillDataSet方法的具体用法?C# QueryDataRes.FillDataSet怎么用?C# QueryDataRes.FillDataSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Estar.Business.DataManager.QueryDataRes
的用法示例。
在下文中一共展示了QueryDataRes.FillDataSet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnCheck_Click
/// <summary>
/// ������ѯ �û����,���ţ����������ż���
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnCheck_Click(object sender, EventArgs e)
{
DataTable tab = this.dbGrid.DataSource as DataTable;
if (null == tab) return;
string filter = "";
filter = "(a.�û���� like '{0}'or a.���� like '%{0}%' or b.name like '%{0}%' or e.���� like '%{0}%')";
filter = string.Format(filter, this.tbcardno.Text.Replace("'", "''"));
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
tab.Clear();
query.FillDataSet(tab.TableName, this.paramwin, ParamManager.setMacroParam(MacroPmType.FW, filter), this.dsUnit);
}
示例2: getUser
public DataTable getUser()
{
//�õ�����Դ
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
this.dsUnit.Tables["������Ա"].Clear();
//ִ�в�ѯ����
NameObjectList ps = new NameObjectList();
ps["ֵ����"] = cbbAccount.Text;
query.FillDataSet("������Ա", ps, this.dsUnit);
return dsUnit.Tables["������Ա"];
}
示例3: getNewDataByCardNo
/// <summary>
/// ��ȡ��������
/// </summary>
public void getNewDataByCardNo(string cardno)
{
NameObjectList pstrans = new NameObjectList();
ParamManager.MergeParam(pstrans, this.paramwin);
pstrans["����"] = cardno;
//��ѯ����
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
DataTable tab = dsUnit.Tables["�����"];
tab.Clear();
query.FillDataSet(tab.TableName, pstrans, this.dsUnit);
}
示例4: btnSelect_Click
/// <summary>
/// ʱ��β飬�������û���ţ����� ����
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnSelect_Click(object sender, EventArgs e)
{
DataTable tab = this.dbHitCard.DataSource as DataTable;
if (null == tab) return;
string filter = " a.ʱ��>=(SELECT convert(datetime,'{0}',121)) and a.ʱ��<=(SELECT convert(datetime,'{1}',121)) and(a.���� like'%{2}%' or a.�û���� like '%{2}%'or b.NAME like'%{2}%' or c.���� like '%{2}%' )";
filter = string.Format(filter, this.cboStart.Text.Replace("'", "''"), this.cboEnd.Text.Replace("'", "''"), this.txtCheck.Text.Replace("'", "''"));
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
tab.Clear();
query.FillDataSet(tab.TableName, this.paramwin, ParamManager.setMacroParam(MacroPmType.FW, filter), this.dsUnit);
}
示例5: GetDEvById
/// <summary>
/// 根据门岗查询设备
/// </summary>
public void GetDEvById(string DoorID)
{
//获取当前单元名称
DataTable tab = this.dbDev.DataSource as DataTable;
if (null == tab) return;
string filter = "";
filter = "门岗ID='{0}'";
filter = string.Format(filter, DoorID.Replace("'", "''"));
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
tab.Clear();
query.FillDataSet(tab.TableName, this.paramwin, ParamManager.setMacroParam(MacroPmType.FW, filter), this.ds);
}
示例6: trvDept_AfterSelect
private void trvDept_AfterSelect(object sender, TreeViewEventArgs e)
{
if (null == e.Node)
return;
//查询明细数据
DataTable tabDetail = this.dsUnit.Tables["组织机构"];
string tag = Convert.ToString(e.Node.Tag);
NameObjectList ps = new NameObjectList();
ParamManager.MergeParam(ps, this.paramwin);
ParamManager.MergeParam(ps, ParamManager.createParam(tag));
ps["UnitCode"] = basefun.valtag(e.Node.Tag.ToString(), "代码");
if (null != tabDetail) tabDetail.Clear();
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
query.FillDataSet("组织机构", ps, this.dsUnit);
checkBox1.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["独立管理"].ToString());
checkBox2.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周一"].ToString());
checkBox3.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周二"].ToString());
checkBox4.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周三"].ToString());
checkBox5.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周四"].ToString());
checkBox6.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周五"].ToString());
checkBox7.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周六"].ToString());
checkBox8.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周日"].ToString());
//if (null == tabChanged)
// return;
//tabDetail = this.dsUnit.Tables["组织机构"];
//TreeNode trnsel, trn;
//trn = trnsel = e.Node;
//string strdept = "";
//while (null != trnsel)
//{
// if (null != trn.FirstNode)
// {
// trn = trn.FirstNode;
// continue;
// }
// string t = Convert.ToString(trn.Tag);
// strdept += " or 部门='" + basefun.valtag(t, "部门") + "'";
// if (trnsel == trn)
// break;
// if (null != trn.NextNode)
// trn = trn.NextNode;
// else
// trn = trn.Parent;
// if (trnsel == trn)
// break;
//}
//if (strdept.Length > 0)
// strdept = strdept.Substring(3);
//BindManager.UpdateTable(tabDetail, tabChanged, strdept);
}
示例7: btnCheck_Click
/// <summary>
/// 条件查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnCheck_Click(object sender, EventArgs e)
{
string StartDtTime = this.cboStartDate.Text + " " + this.cboStartTime.Text;
string EndDtTime = this.cboEndDate.Text + " " + this.cboEndTime.Text;
//获取当前单元名称
DataTable tab = this.dbGrid.DataSource as DataTable;
if (null == tab) return;
string filter = "";
filter = "a.接班时间 between '{0}' and '{1}'and a.接班人 like '%{2}%'and a.交班人 like '%{3}%'";
filter = string.Format(filter, StartDtTime.Replace("'", "''"), EndDtTime.Replace("'", "''"), this.cboStartEmp.Text.Replace("'", "''"), this.cboEndEmp.Text.Replace("'", "''"));
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
tab.Clear();
query.FillDataSet(tab.TableName, this.paramwin, ParamManager.setMacroParam(MacroPmType.FW, filter), this.dsUnit);
}
示例8: BtQuery_Click
/// <summary>
/// 根据条件查询相应的记录
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtQuery_Click(object sender, EventArgs e)
{
NameObjectList ps = new NameObjectList();
ps["StartDate"] = this.dateStart.EditValue;
ps["EndDate"] = this.dateEnd.EditValue;
ps["Type"] = this.lookType.EditValue;
ps["Dept"] = this.lookDept.EditValue;
ps["EmployNO"] = (object)this.txtEmployNo.Text;
ParamManager.MergeParam(ps, this.paramwin,false);
//查询数据
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
DataTable tab = this.grdConsumeList.DataSource as DataTable;
tab.Clear();
query.FillDataSet(tab.TableName, ps, this.ds);
}
示例9: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
XmlDocument xmldoc = new XmlDocument();
//读取用户参数
StreamReader streamreader = new StreamReader(this.Request.InputStream, Encoding.UTF8);
try
{
xmldoc.LoadXml(streamreader.ReadToEnd());
}
catch { };
string[] strParams = this.getStrParams(xmldoc);
NameObjectList paramlist = BuildParamList.BuildParams(xmldoc);
string unitName = BuildParamList.getValue(xmldoc, "UnitName");
if (unitName == "") return;
string workItemName = BuildParamList.getValue(xmldoc, "WorkItem");
//得出workItemName对应的InitFilter=strParams[8]和PageSize=strParams[0]
//for (int i = 0; i < unitItem.WorkItemList.Length; i++)
// if (workItemName == unitItem.WorkItemList[i].ItemName)
// {
// workitem = unitItem.WorkItemList[i];
// strParams[8] = unitItem.WorkItemList[i].InitFilter;
// if ("" != unitItem.WorkItemList[i].PageSize)
// strParams[0] = unitItem.WorkItemList[i].PageSize;
// break;
// }
QueryDataRes query = new QueryDataRes(paramlist["DataSrcFile"].ToString());
DataSet ds = new DataSet(unitName);
ds.EnforceConstraints = false;
string itemdata = paramlist["FilterData"].ToString();
string[] dataItemList = itemdata.Split(",".ToCharArray());
for (int i = 0; i < dataItemList.Length; i++)
{
if ("" == dataItemList[i]) continue;
query.FillDataSet(dataItemList[i], paramlist, strParams, ds);
}
XmlDataDocument xmldocData = new XmlDataDocument(ds);
this.Response.ContentType = "text/xml; charset=gb2312";
xmldocData.Save(this.Response.Output);
}
示例10: BtQuery_Click
/// <summary>
/// 根据条件,查询出相应的记录
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtQuery_Click(object sender, EventArgs e)
{
if ( this.dateStart.Text ==string.Empty )
{
XtraMessageBox.Show("请输入开始时间","系统提示!");
return;
}
if (this.dateEnd.Text == string.Empty)
{
XtraMessageBox.Show("请输入结束时间", "系统提示!");
return;
}
NameObjectList pstrans = new NameObjectList();
ParamManager.MergeParam(pstrans, this.paramwin);
pstrans["StartDate"] = this.dateStart.EditValue.ToString();
pstrans["EndDate"] = this.dateEnd.EditValue.ToString();
//查询数据
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
DataTable tab = this.grdConsumeList.DataSource as DataTable;
if (null == tab) return;
tab.Clear();
query.FillDataSet(tab.TableName, pstrans, this.ds);
}
示例11: getNewDataByCardNo
/// <summary>
/// ���ݿ��Ż�ȡ��ǰ��Ϣ
/// </summary>
public DataTable getNewDataByCardNo(string cardno)
{
NameObjectList pstrans = new NameObjectList();
ParamManager.MergeParam(pstrans, this.paramwin);
pstrans["����"] = cardno;
//��ѯ����
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
DataTable tab = dsUnit.Tables["selectcard"];
tab.Clear();
query.FillDataSet(tab.TableName, pstrans, this.dsUnit);
if (null == tab || tab.Rows.Count < 1) return tab;
status = Convert.ToString(tab.Rows[0]["״̬"]);
return tab;
}
示例12: BtQuery_Click
/// <summary>
/// 条件查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtQuery_Click(object sender, EventArgs e)
{
string StartDtTime = this.StartDate.Text + " " + this.cboStartTime.Text;
string EndDtTime = this.EndDate.Text + " " + this.cboEndTime.Text;
//获取当前单元名称
DataTable tab = this.dbGridIn.DataSource as DataTable;
if (null == tab) return;
string filter = "";
filter = " a.日期 between (SELECT convert(datetime,'{0}',121)) and (SELECT convert(datetime,'{1}',121)+1) and a.用户编号 like '%{2}%' and b.name like '%{3}%' and c.卡类 like '%{4}%' and (a.车牌 like '%{5}%' or a.车牌 is null) and a.卡号 like '%{6}%' and p.名称 like '%{7}%'";
filter = string.Format(filter, StartDtTime.Replace("'", "''"), EndDtTime.Replace("'", "''"), txtuserID.Text.Replace("'", "''"), this.txtuserName.Text.Replace("'", "''"), this.CbCardtype.Text.Replace("'", "''"), TxtCarNo.Text.Replace("'", "''"), TxtCardNo.Text.Replace("'", "''"), this.dtDev.Text.Replace("'", "''"));
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
tab.Clear();
query.FillDataSet(tab.TableName, this.paramwin, ParamManager.setMacroParam(MacroPmType.FW, filter), this.dsUnit);
}
示例13: btnSave_Click_1
/// <summary>
/// ���油����¼���Ŀ�Ƭ���
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnSave_Click_1(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(txtMoney.Text) || moneyList.Items.Count < 1)
{
XtraMessageBox.Show("�������Ϊ�ջ��߿���Ϊ��!", "ϵͳ��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
#region ѭ��д������
for (int i = 0; i < moneyList.Items.Count; i++)
{
string[] sArray = moneyList.Items[i].ToString().Split('(');
foreach (string j in sArray)
{
if (j.ToString().Contains(")"))
{
string[] ssArray = j.ToString().Split(')');
foreach (string h in ssArray)
{
if (!string.IsNullOrEmpty(h.ToString()))
{
string CardNo = h.ToString();
NameObjectList ps = new NameObjectList();
ParamManager.MergeParam(ps, this.paramwin);
ps["����"] = CardNo;
#region ��ѯ��ǰ��¼
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
DataTable tab = dsUnit.Tables["������Ϣ"];
if (null == tab) return;
tab.Clear();
query.FillDataSet(tab.TableName, ps, this.dsUnit);
#endregion
//�����ֵ��¼���Ҹ��¿�Ƭ���
DataRow dr = tab.Rows[0];
dr["����"] = CardNo;
dr["������ֵ"] = txtMoney.Text;
dr["����Ա"] = BindManager.getUser().UserName;
NameObjectList ps1 = ParamManager.createParam(dr);
ParamManager.MergeParam(ps1, this.paramwin, false);
this.Query.ExecuteNonQuery("������Ϣ", ps1, ps1, ps1);
}
}
}
}
}
#endregion
moneyList.Items.Clear();
MessageBox.Show("�����ɹ�", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.None);
}
示例14: CheckByDin
/// <summary>
/// ���ݲ������� ����ʱ��,�˵�,���ѻ�ddd
/// </summary>
/// <param name="db">GridControl</param>
/// <param name="flag">����ʾ</param>
/// <param name="ID">���</param>
public void CheckByDin(DevExpress.XtraGrid.GridControl db, string flag, string ID)
{
try
{
DataTable tab = db.DataSource as DataTable;
if (null == tab) return;
if (string.IsNullOrEmpty(ID)) return;
string filter = "";
switch (flag)
{
case "1":
filter = "����ID='{0}' order by �������";
break;
case "2":
filter = "����ID='{0}'";
break;
case "4":
filter = "a.����ID='{0}'";
break;
case "3":
filter = "����ID='{0}'";
break;
default:
break;
}
filter = string.Format(filter, ID.Replace("'", "''"));
QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
tab.Clear();
query.FillDataSet(tab.TableName, this.paramwin, ParamManager.setMacroParam(MacroPmType.FW, filter), this.ds);
}
catch (Exception ex)
{
}
}
示例15: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Session["userid"] == null)
{
this.Response.Write("<script language=\"javascript\">");
this.Response.Write("alert('您未正常登录,请登录后再使用,谢谢!')");
this.Response.Write("</script>");
this.Response.Redirect("index.htm");
}
string[] strsqls = (this.Request.QueryString["sql"] == null) ? null : this.Request.QueryString["sql"].Split(';');
string prnname = this.Request.QueryString["prn"];
string prntype = this.Request.QueryString["prntype"];
string prnpms = this.Request.QueryString["pms"];
string relation = this.Request.QueryString["relation"];
NameObjectList paramlist = new NameObjectList();
string[] parammacro = { "10", "0", "", "", "", "", "", "", "" };
if (prnpms != null)
{
paramlist = createParam(prnpms);
parammacro = createMacro(prnpms);
}
string[] prndatasrcs = null;
if (this.Request.QueryString["datasrc"] != null)
prndatasrcs = this.Request.QueryString["datasrc"].Split(';');
if (prntype == null) prntype = "excel";
if (prndatasrcs == null) prndatasrcs = new String[] { "table" };
string strCn = DataAccRes.DefaultDataConnInfo.Value;
DataSet ds = new DataSet();
//初始化连接字符串
if (strsqls != null && strsqls.Length > 0)
{
SqlConnection CN = new SqlConnection();
try
{
CN.ConnectionString = strCn;
CN.Open();
for (int i = 0; i < strsqls.Length; i++)
{
if (strsqls[i] == "") continue;
SqlDataAdapter adp = new SqlDataAdapter(strsqls[i], CN);
adp.Fill(ds, prndatasrcs[i]);
}
CN.Close();
}
catch (Exception ex)
{
if (CN.State == ConnectionState.Open) CN.Close();
this.Response.Write("");
return;
}
}
else if (null != prndatasrcs && prndatasrcs.Length > 0)
{
QueryDataRes query = null;
for (int i = 0; i < prndatasrcs.Length; i++)
{
if (string.IsNullOrEmpty(prndatasrcs[i]))
continue;
string[] src = prndatasrcs[i].Split(".".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
if (src.Length < 2)
continue;
query = new QueryDataRes(src[0]);
query.FillDataSet(src[1], paramlist, parammacro, ds);
}
}
if (!ds.Tables.Contains("参数表"))
{
User user = new User(Convert.ToString(Session["userid"]));
string[,] colmap = { { "公司名称", user.Company }, { "部门代码", user.DeptmentCode }, { "部门名称", user.DeptmentName },
{ "上级部门", user.DeptSup }, { "单位名称", user.UnitName }, { "用户名称", user.UserName } };
for (int i = 0; i < colmap.GetLength(0); i++)
{
if (null == paramlist[colmap[i, 0]])
paramlist[colmap[i, 0]] = colmap[i, 1];
}
DataTable tabm = new DataTable("参数表");
foreach (string key in paramlist.AllKeys)
tabm.Columns.Add(key);
DataRow drm = tabm.NewRow();
foreach (string key in paramlist.AllKeys)
drm[key] = Convert.ToString(paramlist[key]);
tabm.Rows.Add(drm);
ds.Tables.Add(tabm);
}
//表关系:master.col~child.col;
if (!string.IsNullOrEmpty(relation))
{
string[] relts = relation.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < relts.Length; i++)
{
string[] rlt = relts[i].Split("~".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
if (rlt.Length < 2) continue;
string[] rltm = rlt[0].Split(".".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
string[] rltd = rlt[1].Split(".".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
if (!ds.Tables.Contains(rltm[0]) || !ds.Tables.Contains(rltd[0]))
continue;
if (!ds.Tables[rltm[0]].Columns.Contains(rltm[1]) || !ds.Tables[rltd[0]].Columns.Contains(rltd[1]))
continue;
DataTable tabm = ds.Tables[rltm[0]];
DataTable tabd = ds.Tables[rltd[0]];
//.........这里部分代码省略.........