根据XML文件路径加载配置文件 UIOperate加载配置文件列
UIOperate uio = new UIOperate(this._protocol, this._address);
string conf_Customer_path = System.Windows.Forms.Application.StartupPath + "/" + this._conf_Directory + "/" + this._xml_CustomerCol;
string conf_CustomerShortCut_path = System.Windows.Forms.Application.StartupPath + "/" +
this._conf_Directory + "/" + this._xml_CustomerShortCutCol;
if (!File.Exists(conf_Customer_path))
{
DataSet ds = uio.GetColInfo("frmCustomer", "QUERY");
SetDataView.SaveConfigDataSet(ds, _conf_Directory, _xml_CustomerCol);
}
if (!File.Exists(conf_CustomerShortCut_path))
{
DataSet ds = uio.GetColInfo("frmCustomerShortCut", "QUERY");
SetDataView.SaveConfigDataSet(ds, _conf_Directory, _xml_CustomerShortCutCol);
}
UIOperate
public class UIOperate
{
UIDisplayProxyClient MyUIDisplayProxy = null;
LocalClientProxy MyLcp = null;
public UIOperate(LocalClientProxy.PROTOCAL protocol, string address)
{
MyLcp = new LocalClientProxy(protocol, address);
MyUIDisplayProxy = MyLcp.GetUIDisplayProxy();
}
public System.Data.DataSet GetColInfo(string name, string type)
{
FeedbackInfomation fi = new FeedbackInfomation();
string jsonResult = MyUIDisplayProxy.GetUICol(name, type);
fi = JsonConvert.DeserializeObject<FeedbackInfomation>(jsonResult);
if (fi.ErrorStatus == STATUS_ADAPTER.QUERY_NORMAL)
{
DataSet ds = JsonConvert.DeserializeObject<DataSet>(fi.Result.ToString());
return ds;
}
else
{
return null;
}
}
public DataSet GetTableStruct(string tablename)
{
FeedbackInfomation fi = new FeedbackInfomation();
string jsonResult = MyUIDisplayProxy.GetUITableStruct(tablename);
fi = JsonConvert.DeserializeObject<FeedbackInfomation>(jsonResult);
if (fi.ErrorStatus == STATUS_ADAPTER.QUERY_NORMAL)
{
DataSet ds = JsonConvert.DeserializeObject<DataSet>(fi.Result.ToString());
return ds;
}
else
{
return null;
}
}
}
网友评论