本文整理汇总了C#中WaitDialogForm.SetCaption方法的典型用法代码示例。如果您正苦于以下问题:C# WaitDialogForm.SetCaption方法的具体用法?C# WaitDialogForm.SetCaption怎么用?C# WaitDialogForm.SetCaption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WaitDialogForm
的用法示例。
在下文中一共展示了WaitDialogForm.SetCaption方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnImportCode_Click
private void btnImportCode_Click(object sender, EventArgs e)
{
WaitDialogForm wait = null;
try
{
OpenFileDialog oP = new OpenFileDialog();
oP.InitialDirectory = "My Documents://";
oP.Filter = HelpExcel.FILTER_FILE_OPEN;
oP.Title = HelpApplication.getTitleForm("Chọn bảng giá kế toán");
if (oP.ShowDialog() == DialogResult.Cancel) return;
System.Windows.Forms.Application.DoEvents();
string filenamepath = oP.FileName;
wait = new WaitDialogForm("Đang xử lý..", "Import code chương trình từ excel!", new Size(250, 50));
string tempFilePath = AppUtil.GetTempFile(Path.GetExtension(filenamepath));
File.Copy(filenamepath, tempFilePath, true);
FileInfo inf = new FileInfo(tempFilePath);
if (inf.IsReadOnly)
{
inf.IsReadOnly = false;
}
wait.SetCaption("Đang kết nối tập tin excel...");
XlsFileConnection conn = new XlsFileConnection(tempFilePath);
if (ValidateConnection(conn, filenamepath, wait) == false)
{
if (wait != null) wait.Close();
return;
}
DataSet ds = new DataSet();
ds = conn.LoadDataSet(CHUONG_TRINH.TABLE_NAME, null);
if (ds == null || ds.Tables.Count == 0)
{
wait.Close();
HelpMsgBox.ShowNotificationMessage("Tập tin excel có cấu trúc không đúng mẫu, vui lòng kiểm tra lại");
return;
}
if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)//Loại bỏ dòng rỗng
{
ds.Tables[0].Rows.RemoveAt(0);
}
conn.Close();
DataTable dt = ds.Tables[0];
dt.Columns.Add(CHUONG_TRINH.CT_ID, typeof(Int64));
dt.Columns.Add("CODE_CT_OLD");
DataRow r = null;
string sql = "select ct.*,ct.code_ct code_ct_old from "+ CHUONG_TRINH.TABLE_NAME + " ct where ct." + CHUONG_TRINH.MA_CT + "='{0}'";
DataSet dsSource = HelpDB.getDBService().LoadDataSet(string.Format(sql, "-1"),CHUONG_TRINH.TABLE_NAME);
DataTable dtSource = dsSource.Tables[0];
DataSet dsTemp = null;
string error = "";
for (int i = 0; i < dt.Rows.Count; i++)
{
r = dt.Rows[i];
dsTemp = HelpDB.getDBService().LoadDataSet(string.Format(sql, r[CHUONG_TRINH.MA_CT]));
if (dsTemp != null && dsTemp.Tables.Count > 0 && dsTemp.Tables[0].Rows.Count > 0)
{
dsTemp.Tables[0].Rows[0][CHUONG_TRINH.CODE_CT] = r[CHUONG_TRINH.CODE_CT];
dtSource.ImportRow(dsTemp.Tables[0].Rows[0]);
}
else
{
error += "";
}
}
gridControlImport.DataSource = dtSource;
;
}
catch (Exception ex)
{
if (wait != null) wait.Close();
HelpMsgBox.ShowNotificationMessage("Tập tin excel có cấu trúc không đúng mẫu, vui lòng kiểm tra lại.");
PLException.AddException(ex);
return;
}
finally
{
if (wait != null) wait.Close();
}
}
示例2: ReCount
private void ReCount()
{
WaitDialogForm wait = new WaitDialogForm("", "正在更新数据,请稍后...");
int m = 0;
foreach (TreeListNode node in treeList1.Nodes)
{
m++;
IList<Ps_Forecast_Math> relist = new List<Ps_Forecast_Math>();
double qzvalue = 0;
foreach (TreeListNode cnode in node.Nodes)
{
DataRow row = (cnode.TreeList.GetDataRecordByNode(cnode) as DataRowView).Row;
Ps_Forecast_Math v = DataConverter.RowToObject<Ps_Forecast_Math>(row);
double mm = v.y1990;
string select = v.Col2;
if (select == "1")
{
qzvalue += mm;
relist.Add(v);
}
}
//wait.SetCaption(m * 100 / treeList1.Nodes.Count + "%");
node.SetValue("y1990", qzvalue);
for (int i = forecastReport.StartYear; i <= forecastReport.YcEndYear; i++)
{
int persent = ((m - 1) * (forecastReport.YcEndYear - forecastReport.StartYear + 1) + i - forecastReport.StartYear) * 100 / (treeList1.Nodes.Count * (forecastReport.YcEndYear - forecastReport.StartYear + 1));
wait.SetCaption(persent + "%");
double sum = 0;
foreach (Ps_Forecast_Math pfm in relist)
{
double mm = pfm.y1990;
sum += double.Parse(pfm.GetType().GetProperty("y" + i).GetValue(pfm, null).ToString()) * mm;
}
commonhelp.ResetValue(node["ID"].ToString(), "y" + i);
node.SetValue("y" + i, sum);
}
}
RefreshChart();
wait.Close();
}
示例3: RestoreGTLatLngTQ
/// <summary>
/// 备份一个台区的杆塔经纬度
/// </summary>
/// <param name="lineCode"></param>
internal static void RestoreGTLatLngTQ(string tqCode) {
WaitDialogForm waitdlg = new WaitDialogForm("", "恢复台区经纬度");
IList<PS_xl> listxl = Client.ClientHelper.PlatformSqlMap.GetList<PS_xl>(string.Format("where left(linecode,{0})='{1}' and linevol='0.4'", tqCode.Length, tqCode));
foreach (PS_xl item in listxl) {
waitdlg.SetCaption(item.LineName);
RestoreGTLatLng(item.LineCode);
}
waitdlg.Close();
}
示例4: GetImportDataSet
public DataSet GetImportDataSet()
{
WaitDialogForm wait = null;
try
{
OpenFileDialog oP = new OpenFileDialog();
oP.InitialDirectory = "My Documents://";
oP.Filter = HelpExcel.FILTER_FILE_OPEN;
oP.Title = HelpApplication.getTitleForm("Import dữ liệu từ tập tin excel");
if (oP.ShowDialog() == DialogResult.Cancel) return null;
System.Windows.Forms.Application.DoEvents();
string filenamepath = oP.FileName;
wait = new WaitDialogForm("Đang xử lý..", "Import dữ liệu từ excel!", new Size(250, 50));
string tempFilePath = AppUtil.GetTempFile(Path.GetExtension(filenamepath));
File.Copy(filenamepath, tempFilePath, true);
FileInfo inf = new FileInfo(tempFilePath);
if (inf.IsReadOnly)
{
inf.IsReadOnly = false;
}
wait.SetCaption("Đang kết nối tập tin excel...");
XlsFileConnection conn = new XlsFileConnection(tempFilePath);
if (ValidateConnection(conn, filenamepath, wait) == false)
{
if (wait != null) wait.Close();
return null;
}
DataSet ds = new DataSet();
ds = conn.LoadDataSet(BANG_GIA_BUDGET_CT.TABLE_NAME, null);
if (ds == null)
{
wait.Close();
HelpMsgBox.ShowNotificationMessage("Tập tin excel có cấu trúc không đúng mẫu, vui lòng kiểm tra lại");
return null;
}
if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)//Loại bỏ dòng rỗng
{
ds.Tables[0].Rows.RemoveAt(0);
}
conn.Close();
System.Windows.Forms.Application.DoEvents();
return ds;
}
catch (Exception ex)
{
if (wait != null) wait.Close();
HelpMsgBox.ShowNotificationMessage("Tập tin excel có cấu trúc không đúng mẫu, vui lòng kiểm tra lại.");
PLException.AddException(ex);
return null;
}
finally
{
if (wait != null) wait.Close();
}
}
示例5: CalcAll
//按总值计算
private void CalcAll()
{
if (firstyear == "0" || endyear == "0")
{
MsgBox.Show("请设置历史数据起始年结束年后再点参数设置");
return;
}
treeList1.BeginInit();
WaitDialogForm wait = new WaitDialogForm("", "正在重新计算,请稍后...");
int allsum = forecastReport.YcEndYear - forecastReport.StartYear;
if (gdprows.Length>0&&dlrows.Length>0&&dhrows.Length>0)
{
DataRow gdprow = gdprows[0];
DataRow dlrow = dlrows[0];
DataRow dhrow = dhrows[0];
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
wait.SetCaption((i - forecastReport.StartYear) * 100 / allsum + "%");
double gdp = double.Parse(gdprow["y" + i].ToString());
double dl = double.Parse(dlrow["y" + i].ToString());
double dh = double.Parse(dhrow["y" + i].ToString());
if (gdp != 0)
{
dh = dl * unitdata / gdp;
}
else
{
dh = 0;
}
dhrow["y" + i]= Math.Round(dh, 4);
//commonhelp.ResetValue(dhrow["ID"].ToString(), "y" + i);
}
Ps_Forecast_Math dhpfm = DataConverter.RowToObject<Ps_Forecast_Math>(dhrow);
Common.Services.BaseService.Update<Ps_Forecast_Math>(dhpfm);
for (int i = forecastReport.YcStartYear; i <= forecastReport.YcEndYear; i++)
{
wait.SetCaption((i - forecastReport.StartYear) * 100 / allsum + "%");
double gdp = double.Parse(gdprow["y" + i].ToString());
double dl = double.Parse(dlrow["y" + i].ToString());
double dh = double.Parse(dhrow["y" + i].ToString());
dl = dh * gdp / unitdata;
dlrow["y" + i] = Math.Round(dl, 4);
//commonhelp.ResetValue(dlrow["ID"].ToString(), "y" + i);
}
dlrow["Col4"] = "yes";
Ps_Forecast_Math dlpfm = DataConverter.RowToObject<Ps_Forecast_Math>(dlrow);
Common.Services.BaseService.Update<Ps_Forecast_Math>(dlpfm);
}
else
{
MessageBox.Show("记录不正确,无法计算!");
}
treeList1.EndInit();
wait.Close();
}
示例6: CalcPer
//按三产单耗计算
private void CalcPer()
{
//生产总值(亿元)
//用电量(亿kWh)
//单耗(kW/万元)
//计算数据
DataRow gdprow = gdprows[0];
DataRow gdprow01 = gdprows01[0];
DataRow gdprow02 = gdprows02[0];
DataRow gdprow03 = gdprows03[0];
DataRow dlrow = dlrows[0];
DataRow dlrow01 = dlrows01[0];
DataRow dlrow02 = dlrows02[0];
DataRow dlrow03 = dlrows03[0];
DataRow dlrow04 = dlrows04[0];
DataRow dhrow = dhrows[0];
DataRow dhrow01 = dhrows01[0];
DataRow dhrow02 = dhrows02[0];
DataRow dhrow03 = dhrows03[0];
WaitDialogForm wait = new WaitDialogForm("","正在重新计算,请稍后...");
treeList1.BeginInit();
int allsum = forecastReport.YcEndYear - forecastReport.StartYear;
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
wait.SetCaption ((i - forecastReport.StartYear) * 100 / allsum + "%");
//总单耗
double gdp = double.Parse(gdprow["y" + i].ToString());
double dl = double.Parse(dlrow["y" + i].ToString());
double dh = double.Parse(dhrow["y" + i].ToString());
if (gdp != 0)
{
dh = dl * unitdata / gdp;
}
else
{
dh = 0;
}
dhrow["y" + i] = Math.Round(dh, 4);
//commonhelp.ResetValue(dhrow["ID"].ToString(), "y" + i);
//分单耗01
double gdp01 = double.Parse(gdprow01["y" + i].ToString());
double dl01 = double.Parse(dlrow01["y" + i].ToString());
double dh01 = double.Parse(dhrow01["y" + i].ToString());
if (gdp01 != 0)
{
dh01 = dl01 * unitdata / gdp01;
}
else
{
dh01 = 0;
}
dhrow01["y" + i] = Math.Round(dh01, 4);
//commonhelp.ResetValue(dhrow01["ID"].ToString(), "y" + i);
//分单耗02
double gdp02 = double.Parse(gdprow02["y" + i].ToString());
double dl02 = double.Parse(dlrow02["y" + i].ToString());
double dh02 = double.Parse(dhrow02["y" + i].ToString());
if (gdp02 != 0)
{
dh02 = dl02 * unitdata / gdp02;
}
else
{
dh02 = 0;
}
dhrow02["y" + i] = Math.Round(dh02, 4);
//commonhelp.ResetValue(dhrow02["ID"].ToString(), "y" + i);
//分单耗03
double gdp03 = double.Parse(gdprow03["y" + i].ToString());
double dl03 = double.Parse(dlrow03["y" + i].ToString());
double dh03 = double.Parse(dhrow03["y" + i].ToString());
if (gdp03 != 0)
{
dh03 = dl03 * unitdata / gdp03;
}
else
{
dh03 = 0;
}
dhrow03["y" + i] = Math.Round(dh03, 4);
//commonhelp.ResetValue(dhrow03["ID"].ToString(), "y" + i);
}
Ps_Forecast_Math dhpfm = DataConverter.RowToObject<Ps_Forecast_Math>(dhrow);
Ps_Forecast_Math dhpfm01 = DataConverter.RowToObject<Ps_Forecast_Math>(dhrow01);
Ps_Forecast_Math dhpfm02 = DataConverter.RowToObject<Ps_Forecast_Math>(dhrow02);
Ps_Forecast_Math dhpfm03 = DataConverter.RowToObject<Ps_Forecast_Math>(dhrow03);
Common.Services.BaseService.Update<Ps_Forecast_Math>(dhpfm);
Common.Services.BaseService.Update<Ps_Forecast_Math>(dhpfm01);
Common.Services.BaseService.Update<Ps_Forecast_Math>(dhpfm02);
Common.Services.BaseService.Update<Ps_Forecast_Math>(dhpfm03);
//.........这里部分代码省略.........
示例7: btImport_Click_1
private void btImport_Click_1(object sender, EventArgs e)
{
//����
if (checkedListBox1.SelectedItem == null) return;
IEnumerator ie = null;
switch (checkedListBox1.SelectedItem.ToString()) {
case "ĸ��":
ie = importMX();
break;
case "��·":
ie = importXL();
break;
case "�������ѹ��":
ie = importBYQ2();
break;
case "�������ѹ��":
ie = importBYQ3();
break;
case "�����":
ie = importFDJ();
break;
case "����":
ie = importFH();
break;
case "����������":
ie = importBLDR();
break;
}
if (gridControl1.DataSource!=null)
{
ncount = (gridControl1.DataSource as DataTable).Rows.Count;
ncurrent = 0;
if (ie != null)
{
WaitDialogForm msgbox = new WaitDialogForm("", "�������ݣ����Ժ���");
msgbox.Show();
while (ie.MoveNext())
{
msgbox.SetCaption(string.Format("�����{0}/{1}", ncurrent, ncount));
}
Thread.Sleep(1000);
msgbox.Close();
}
}
}
示例8: barButtonItem1_ItemClick
/// <summary>
/// 加载GDP数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (treeList1.Nodes.Count<0)
{
return;
}
MessageBox.Show("请选择GDP一产、二产、三产数据");
FormForecastLoadData2 ffs = new FormForecastLoadData2();
ffs.ISGDP = true;
ffs.PID = MIS.ProgUID;
ffs.StartYear = forecastReport.StartYear;
ffs.EndYear = forecastReport.EndYear;
if (ffs.ShowDialog() != DialogResult.OK)
return;
Hashtable hs = ffs.HS;
if (hs.Count == 0)
return;
DataRow gdprow = gdprows[0];
DataRow gdprow01 = gdprows01[0];
DataRow gdprow02 = gdprows02[0];
DataRow gdprow03 = gdprows03[0];
Ps_History gdph01 = null;
Ps_History gdph02 = null;
Ps_History gdph03 = null;
bool have = false;
foreach (Ps_History de3 in hs.Values)
{
if (de3.Title.Contains("一产"))
{
gdph01 = de3;
have = true;
continue;
}
if (de3.Title.Contains("二产"))
{
gdph02 = de3;
have = true;
continue;
}
if (de3.Title.Contains("三产"))
{
gdph03 = de3;
have = true;
continue;
}
}
if (have)
{
double db01 = 0;
double db02 = 0;
double db03 = 0;
WaitDialogForm wait = new WaitDialogForm("", "正在载入数据,请稍后...");
treeList1.BeginInit();
int sum = forecastReport.EndYear - forecastReport.StartYear;
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
int per = (i - forecastReport.StartYear) * 100 / sum;
wait.SetCaption(per + "%");
if (gdph01!=null)
{
gdprow01["y" + i] = gdph01.GetType().GetProperty("y" + i).GetValue(gdph01, null);
//commonhelp.ResetValue(gdprow01["ID"].ToString(), "y" + i);
}
if (gdph02 != null)
{
gdprow02["y" + i] = gdph02.GetType().GetProperty("y" + i).GetValue(gdph02, null);
//commonhelp.ResetValue(gdprow02["ID"].ToString(), "y" + i);
}
if (gdph03 != null)
{
gdprow03["y" + i] = gdph03.GetType().GetProperty("y" + i).GetValue(gdph03, null);
//commonhelp.ResetValue(gdprow03["ID"].ToString(), "y" + i);
}
db01 = double.Parse(gdprow01["y" + i].ToString());
db02 = double.Parse(gdprow02["y" + i].ToString());
db03 = double.Parse(gdprow03["y" + i].ToString());
gdprow["y" + i] = db01 + db02 + db03;
}
Ps_Forecast_Math gdppfm01 = DataConverter.RowToObject<Ps_Forecast_Math>(gdprow01);
Ps_Forecast_Math gdppfm02 = DataConverter.RowToObject<Ps_Forecast_Math>(gdprow02);
Ps_Forecast_Math gdppfm03 = DataConverter.RowToObject<Ps_Forecast_Math>(gdprow03);
Ps_Forecast_Math gdppfm = DataConverter.RowToObject<Ps_Forecast_Math>(gdprow);
Common.Services.BaseService.Update<Ps_Forecast_Math>(gdppfm01);
Common.Services.BaseService.Update<Ps_Forecast_Math>(gdppfm02);
Common.Services.BaseService.Update<Ps_Forecast_Math>(gdppfm03);
Common.Services.BaseService.Update<Ps_Forecast_Math>(gdppfm);
treeList1.EndInit();
//.........这里部分代码省略.........
示例9: barButtonItem20_ItemClick
//更新线路
private void barButtonItem20_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
Hashtable area_key_id = new Hashtable();
//初始化哈希表
string areaall = " ProjectID='" + GetProjectID + "'";
IList<PS_Table_AreaWH> tempPTA = Common.Services.BaseService.GetList<PS_Table_AreaWH>("SelectPS_Table_AreaWHByConn", areaall);
if (tempPTA.Count != 0)
{
for (int i = 0; i < tempPTA.Count; i++)
{
area_key_id.Add(tempPTA[i].ID, tempPTA[i].Title);
}
}
int year = yAnge.StartYear;
string con = "Col4='line' and ProjectID='" + GetProjectID + "' and ParentID='0'";
IList list = Common.Services.BaseService.GetList("SelectPs_Table_BuildProByConn", con);
DataTable dt = Itop.Common.DataConverter.ToDataTable(list, typeof(Ps_Table_BuildPro));
string con2 = "Col4='line' and ProjectID='" + GetProjectID + "'";
IList list2 = Common.Services.BaseService.GetList("SelectPs_Table_BuildProByConn", con2);
DataTable dt2 = Itop.Common.DataConverter.ToDataTable(list2, typeof(Ps_Table_BuildPro));
WaitDialogForm wait = new WaitDialogForm("", "正在更新线路数据,请稍后...");
for (int i = 0; i < dt.Rows.Count; i++)
{
string parentid = dt.Rows[i]["ID"].ToString();
string dy = dt.Rows[i]["FromID"].ToString();
string connjz = " where ProjectID ='" + GetProjectID + "' and Type='05' and RateVolt=" + dy + " and Cast(Date1 as int)>" + year;
IList<PSPDEV> listatt = Common.Services.BaseService.GetList<PSPDEV>("SelectPSPDEVByCondition", connjz);
int mm = 0;
foreach (PSPDEV psi in listatt)
{
mm++;
int perent = (i + 1) * 100 * mm / listatt.Count / dt.Rows.Count;
wait.SetCaption(perent + "%");
Ps_Table_BuildPro table1 = new Ps_Table_BuildPro();
table1.ID += "|" + GetProjectID;
table1.Title = psi.Name;
table1.ParentID = parentid;
table1.ProjectID = GetProjectID;
table1.BuildYear = psi.Date1;
table1.BuildEd = psi.OperationYear;
table1.FromID = dy;
table1.Length = psi.LineLength+psi.Length2;
// table1.BefVolumn = frm.AllVol;
table1.GetType().GetProperty("y" + psi.Date1).SetValue(table1, table1.Length, null);
table1.Col4 = "line";
table1.Sort = OperTable.GetBuildProMaxSort() + 1;
table1.Col10 = psi.SUID;
table1.Col3 = "新建";
if (area_key_id[psi.AreaID]!=null)
{
table1.AreaName = area_key_id[psi.AreaID].ToString();
}
try
{
if (DTHave(dt2, psi.SUID))
{
UPDateOldXl(dt2, psi.SUID, table1);
}
else
{
Common.Services.BaseService.Create("InsertPs_Table_BuildPro", table1);
dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(table1, dataTable.NewRow()));
AddChildVol(table1, true);
}
}
catch (Exception ee)
{
wait.Close();
}
}
}
LoadData1();
wait.Close();
}
示例10: barButtonItem19_ItemClick
//更新变电站
private void barButtonItem19_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
int year = yAnge.StartYear;
string con = "Col4='bian' and ProjectID='" + GetProjectID + "' and ParentID='0'";
IList list = Common.Services.BaseService.GetList("SelectPs_Table_BuildProByConn", con);
DataTable dt = Itop.Common.DataConverter.ToDataTable(list, typeof(Ps_Table_BuildPro));
string con2 = "Col4='bian' and ProjectID='" + GetProjectID + "'";
IList list2 = Common.Services.BaseService.GetList("SelectPs_Table_BuildProByConn", con2);
DataTable dt2 = Itop.Common.DataConverter.ToDataTable(list2, typeof(Ps_Table_BuildPro));
WaitDialogForm wait = new WaitDialogForm("", "正在更新变电站数据,请稍后...");
for (int i = 0; i < dt.Rows.Count; i++)
{
string parentid = dt.Rows[i]["ID"].ToString();
string dy = dt.Rows[i]["FromID"].ToString();
string conn1 = " AreaID='" + GetProjectID + "' and L1=" + dy;
IList<PSP_Substation_Info> listbdz = Common.Services.BaseService.GetList<PSP_Substation_Info>("SelectPSP_Substation_InfoListByWhere", conn1);
int mm = 0;
foreach (PSP_Substation_Info psi in listbdz)
{
mm++;
int perent=(i+1) * 100*mm/listbdz.Count / dt.Rows.Count;
wait.SetCaption( perent+ "%");
string dyid = psi.UID;
string connjz = " where SvgUID ='" + dyid + "' and Type='03'";
IList<PSPDEV> listatt = Common.Services.BaseService.GetList<PSPDEV>("SelectPSPDEVByCondition", connjz);
DataTable dataTable = Itop.Common.DataConverter.ToDataTable((IList)listatt, typeof(PSPDEV));
if (listatt.Count>0)
{
DataRow[] xyrow=dataTable.Select(" Date1<="+year);
DataRow[] dyrow=dataTable.Select(" Date1>"+year ,"Date1");
if (dyrow.Length>0)
{
if (xyrow.Length>0)
{
int start=int.Parse(dyrow[0]["Date1"].ToString());
int end=int.Parse(dyrow[dyrow.Length-1]["Date1"].ToString());
//扩建
for (int j = start; j <= end; j++)
{
DataRow[] curow=dataTable.Select(" Date1="+j );
if (curow.Length==0)
{
continue;
}
Ps_Table_BuildPro table1 = new Ps_Table_BuildPro();
table1.ID += "|" + GetProjectID;
table1.Title = psi.Title;
table1.ParentID = parentid;
table1.ProjectID = GetProjectID;
table1.BuildYear =j.ToString();
table1.BuildEd = curow[0]["OperationYear"].ToString();
table1.FromID = dy;
table1.Volumn = double .Parse( curow[0]["SiN"].ToString());
table1.Col4 = "bian";
table1.Sort = OperTable.GetBuildProMaxSort() + 1;
table1.Col10 = curow[0]["SUID"].ToString();
table1.Col3="扩建";
table1.AreaName = psi.AreaName;
for (int k = 1; k < curow.Length; k++)
{
table1.Volumn += double .Parse( curow[k]["SiN"].ToString());
}
table1.GetType().GetProperty("y" + j).SetValue(table1, table1.Volumn, null);
try
{
if (DTHave(dt2,curow[0]["SUID"].ToString()))
{
UPDateOldBDZ(dt2,curow[0]["SUID"].ToString(),table1);
}
else
{
Common.Services.BaseService.Create("InsertPs_Table_BuildPro", table1);
dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(table1, dataTable.NewRow()));
AddChildVol(table1, true);
}
}
catch (Exception ee)
{
wait.Close();
}
}
}
else
{
//新建+扩建
int start=int.Parse(dyrow[0]["Date1"].ToString());
int end=int.Parse(dyrow[dyrow.Length-1]["Date1"].ToString());
//.........这里部分代码省略.........
示例11: FileReadV
public void FileReadV(string projectSUID, string projectid, int dulutype, double ratecaplity, WaitDialogForm wf, bool shortiflag, StringBuilder duanResult)
{
FileStream shorcuit = new FileStream(System.Windows.Forms.Application.StartupPath + "\\ShortcuitI.txt", FileMode.Open);
StreamReader readLineGU = new StreamReader(shorcuit, System.Text.Encoding.Default);
string strLineGU;
string[] arrayGU;
char[] charSplitGU = new char[] { ' ' };
int intshorti = 0;
while ((strLineGU = readLineGU.ReadLine()) != null)
{
arrayGU = strLineGU.Split(charSplitGU, StringSplitOptions.RemoveEmptyEntries);
string[] shorti = arrayGU;
shorti.Initialize();
//int m = 0;
//foreach (string str in arrayGU)
//{
// if (str != "")
// {
// shorti[m++] = str.ToString();
// }
//}
if (intshorti == 0)
{
if (!shortiflag)
{
duanResult.Append(shorti[0] + "," + shorti[1] + "," + shorti[3] + "\r\n");
shortiflag = true;
}
}
else
duanResult.Append(shorti[0] + "," + shorti[1] + "," + Convert.ToDouble(shorti[3]) + "\r\n");
intshorti++;
wf.SetCaption(intshorti.ToString());
}
readLineGU.Close();
}
示例12: FileReadDV
public void FileReadDV(string projectSUID, string projectid, int dulutype, double ratecaplity, WaitDialogForm wf, string con, StringBuilder dianYaResult)
{
if (File.Exists(System.Windows.Forms.Application.StartupPath + "\\Sxdianya.txt"))
{
}
else
{
return;
}
FileStream dianYa = new FileStream(System.Windows.Forms.Application.StartupPath + "\\Sxdianya.txt", FileMode.Open);
StreamReader readLineDY = new StreamReader(dianYa, System.Text.Encoding.Default);
string strLineDY;
string[] arrayDY;
char[] charSplitDY = new char[] { ' ' };
strLineDY = readLineDY.ReadLine();
int j = 0;
int muxiannum = 0;
while (strLineDY != null)
{
arrayDY = strLineDY.Split(charSplitDY, StringSplitOptions.RemoveEmptyEntries);
//int m = 0;
string[] dev = arrayDY;
//dev.Initialize();
//foreach (string str in arrayDY)
//{
// if (str != "")
// {
// dev[m++] = str;
// }
//}
if (j == 0)
{
//dianYaResult += "\r\n" + "����ĸ�ߣ�" + pspDev.Name + "\r\n";
dianYaResult.Append(dev[0] + "," + dev[1] + "," + dev[2] + "," + dev[3] + "," + dev[4] + "," + dev[5] + "," + dev[6] + "," + dev[7] + "," + dev[8] + "," +
dev[9] + "," + dev[10] + "," + dev[11] + "," + dev[12] + "," + dev[13] + "\r\n");
}
else
{
if (dev[0] == "����ĸ��")
{
dianYaResult.Append("\r\n" + "����ĸ�ߣ�" + dev[1] + "\r\n");
}
else
{
bool dianyaflag = true; //�жϴ�ĸ���Ƕ�·��ĸ����һ���ĸ��
PSPDEV CR = new PSPDEV();
if (dev[1] != "du")
{
con = " WHERE Name='" + dev[1] + "' AND ProjectID = '" + projectid + "'" + "AND Type='01'";
CR = (PSPDEV)UCDeviceBase.DataService.GetObject("SelectPSPDEVByCondition", con);
if (CR == null)
{
dianyaflag = false;
}
}
//else
//{
// dianyaflag = false;
// CR.Name = duanluname;
// CR = (PSPDEV)UCDeviceBase.DataService.GetObject("SelectPSPDEVByNameANDSVG", CR);
//}
if (dianyaflag)
dianYaResult.Append(dev[0] + "," + dev[1] + "," + Convert.ToDouble(dev[2]) * CR.ReferenceVolt + "," + dev[3] + "," + Convert.ToDouble(dev[4]) * CR.ReferenceVolt + "," + dev[5] + "," + Convert.ToDouble(dev[6]) * CR.ReferenceVolt + "," + dev[7] + "," + Convert.ToDouble(dev[8]) * CR.ReferenceVolt + "," +
dev[9] + "," + Convert.ToDouble(dev[10]) * CR.ReferenceVolt + "," + dev[11] + "," + Convert.ToDouble(dev[12]) * CR.ReferenceVolt + "," + dev[13] + "\r\n");
//else
// dianYaResult.Append( dev[0] + "," + duanluname + "�϶�·��" + "," + Convert.ToDouble(dev[2]) * CR.ReferenceVolt + "," + dev[3] + "," + Convert.ToDouble(dev[4]) * CR.ReferenceVolt + "," + dev[5] + "," + Convert.ToDouble(dev[6]) * CR.ReferenceVolt + "," + dev[7] + "," + Convert.ToDouble(dev[8]) * CR.ReferenceVolt + "," +
// dev[9] + "," + Convert.ToDouble(dev[10]) * CR.ReferenceVolt + "," + dev[11] + Convert.ToDouble(dev[12]) * CR.ReferenceVolt + "," + dev[13] + "\r\n";
}
}
strLineDY = readLineDY.ReadLine();
muxiannum++;
j++;
wf.SetCaption(muxiannum.ToString());
}
readLineDY.Close();
}
示例13: FileReadDL
public void FileReadDL(string projectSUID, string projectid, int dulutype, double ratecaplity, WaitDialogForm wf, string con, StringBuilder dianLiuResult)
{
if (File.Exists(System.Windows.Forms.Application.StartupPath + "\\Sxdianliu.txt"))
{
}
else
{
return;
}
FileStream dianLiu = new FileStream(System.Windows.Forms.Application.StartupPath + "\\Sxdianliu.txt", FileMode.Open);
StreamReader readLineDL = new StreamReader(dianLiu, System.Text.Encoding.Default);
string strLineDL;
string[] arrayDL;
char[] charSplitDL = new char[] { ' ' };
strLineDL = readLineDL.ReadLine();
int j = 0;
int linenum = 0;
while (strLineDL != null)
{
arrayDL = strLineDL.Split(charSplitDL, StringSplitOptions.RemoveEmptyEntries);
int m = 0;
string[] dev = arrayDL;
//dev.Initialize();
//foreach (string str in arrayDL)
//{
// if (str != "")
// {
// dev[m++] = str;
// }
//}
if (j == 0)
{
//dianLiuResult.Append( "\r\n" + "����ĸ�ߣ�" + pspDev.Name + "\r\n";
dianLiuResult.Append(dev[0] + "," + dev[1] + "," + dev[2] + "," + dev[3] + "," + dev[4] + "," + dev[5] + "," + dev[6] + "," + dev[7] + "," + dev[8] + "," +
dev[9] + "," + dev[10] + "," + dev[11] + "," + dev[12] + "," + dev[13] + "," + dev[14] + "\r\n");
}
else
{
if (dev[0] == "����ĸ��")
{
dianLiuResult.Append("\r\n" + "����ĸ�ߣ�" + dev[1] + "\r\n");
}
else
{
PSPDEV CR = new PSPDEV();
if (dev[0] != "du")
{
con = " WHERE Name='" + dev[0] + "' AND ProjectID = '" + projectid + "'" + "AND Type='01'";
}
else
con = " WHERE Name='" + dev[1] + "' AND ProjectID = '" + projectid + "'" + "AND Type='01'";
CR = (PSPDEV)UCDeviceBase.DataService.GetObject("SelectPSPDEVByCondition", con);
dianLiuResult.Append(dev[0] + "," + dev[1] + "," + dev[2] + "," + Convert.ToDouble(dev[3]) * ratecaplity / (Math.Sqrt(3) * CR.ReferenceVolt) + "," + dev[4] + "," + Convert.ToDouble(dev[5]) * ratecaplity / (Math.Sqrt(3) * CR.ReferenceVolt) + "," + dev[6] + "," + Convert.ToDouble(dev[7]) * ratecaplity / (Math.Sqrt(3) * CR.ReferenceVolt) + "," + dev[8] + "," +
Convert.ToDouble(dev[9]) * ratecaplity / (Math.Sqrt(3) * CR.ReferenceVolt) + "," + dev[10] + "," + Convert.ToDouble(dev[11]) * ratecaplity / (Math.Sqrt(3) * CR.ReferenceVolt) + "," + dev[12] + "," + Convert.ToDouble(dev[13]) * ratecaplity / (Math.Sqrt(3) * CR.ReferenceVolt) + "," + dev[14] + "\r\n");
}
//��Ϊ����·�������ʱ����һ����·�ĵ��������������������·�ĵ������нӵص������͵翹���ĵ��������ֻ���������������
}
strLineDL = readLineDL.ReadLine();
j++;
linenum++;
wf.SetCaption(linenum.ToString());
}
readLineDL.Close();
}