设为首页 加入收藏

TOP

JCFXBL辅助类----Helper类介绍 (二)
2014-11-23 22:57:34 来源: 作者: 【 】 浏览:4
Tags:JCFXBL 辅助 ----Helper 介绍
ParmValue);

}

if (BIR.Request())
{
SrvResponse r = new SrvResponse(BIR.Response());
if (r.return_value == "1")
{
DataTable dt = r.GetResultTable();
dgv.DataSource = dt;

}
else
{
MessageBox.Show(BIR.Response());
}
}
else
{

MessageBox.Show(BIR.Response());
}
}


///
/// 把从数据库查询到的数据填充到一个DataTable对象中
///

/// 存储过程名称
/// 查询参数
///
public static DataTable FillDataTable(string act, System.Collections.ArrayList Parms)
{
BIRequest BIR = new BIRequest();
BIR.url = JCFXBL.API.Helper.ServerUrl + "Execute.ashx Serlet=GetDBStore&ACT=" + act;

if (Parms != null)
for (int i = 0; i < Parms.Count; i++)
{
PostParm p = (PostParm)Parms[i];
BIR.AddFormParam(p.ParmName, p.ParmValue);

}

if (BIR.Request())
{
SrvResponse r = new SrvResponse(BIR.Response());
if (r.return_value == "1")
{
DataTable dt = r.GetResultTable();

return dt;

}
else
{
MessageBox.Show(BIR.Response());
}
}
else
{

MessageBox.Show(BIR.Response());
}

return null;
}
}
}

using JCFXBL.SrvInterface;
using JCFXBL.SrvInterface.Core.ProtocolLayer;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace JCFXBL.API
{
public class Helper
{
public static string ServerUrl;

///


/// 把DIC字典数据自动填充进combox控件
///

/// 字典名称
/// combox控件对象
public static void FillComboxByDic(string dic, ComboBox cmb)
{
BIRequest BIR = new BIRequest();
BIR.url = Helper.ServerUrl + "Execute.ashx Serlet=GetDICStore&ACT=GET&dic=" + dic;
if (BIR.Request())
{
try
{
SrvResponse r = new SrvResponse(BIR.Response());
DataTable dt = r.GetResultTable();
cmb.DataSource = dt;
cmb.DisplayMember = "value";
cmb.ValueMember = "key";
}
catch (Exception ex)
{
// MessageBox.Show(ex.Message);
}
}
}

///


/// 把数据表中对应的数据字段填充进combox控件
///

/// combox控件对象
/// 查询参数
/// 存储过程名称
/// combox显示字段
/// combox值字段
public static void FillComboBoxByTable(ComboBox cmb, System.Collections.ArrayList Parms, string act, string DisplayMember, string ValueMember)
{
BIRequest BIR = new BIRequest();
BIR.url = Helper.ServerUrl + "Execute.ashx Serlet=GetDBStore&ACT=" + act;

首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇C语言"#","#@&qu.. 下一篇杭电2011

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: