本文整理汇总了C#中Itop.Domain.Forecast.Ps_Forecast_Math.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Ps_Forecast_Math.GetType方法的具体用法?C# Ps_Forecast_Math.GetType怎么用?C# Ps_Forecast_Math.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Itop.Domain.Forecast.Ps_Forecast_Math
的用法示例。
在下文中一共展示了Ps_Forecast_Math.GetType方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: barButtonItem29_ItemClick
//.........这里部分代码省略.........
str = "ָ��ƽ����";
break;
case 6:
str = "��ɫģ�ͷ�";
break;
case 7:
str = "ר�Ҿ��߷�";
break;
case 20:
str = "�����㷨";
break;
case 10:
str = "��Ȩ���ϵ����";
break;
case 11:
str = "����������-���û�Ԥ�ⷨ";
break;
}
//if (m != 11)
//{
// if ( pf1.Title.Contains("-") && pf1.Title.Contains("����"))
// {
// continue;
// }
pf1.Title = pf1.Title + "<" + str + ">";
for (int j = forecastReport.StartYear; j <= forecastReport.EndYear; j++)
{
double value2 = Math.Round(Convert.ToDouble(pfvalue.GetType().GetProperty("y" + j.ToString()).GetValue(pfvalue, null)), 2);
double value = Math.Round(Convert.ToDouble(pf1.GetType().GetProperty("y" + j.ToString()).GetValue(pf1, null)), 2);
value = Math.Round((value + value2), 2);
pfvalue.GetType().GetProperty("y" + j.ToString()).SetValue(pfvalue, value, null);
}
pf1.Sort = li.Count;
icount++;
al.Add(pf1.Title);
li.Add(pf1);
}
//else
//{
// if (pf1.Title.Contains("-")||true)
// {
// IList<Ps_forecast_list> listReports = Common.Services.BaseService.GetList<Ps_forecast_list>("SelectPs_forecast_listByWhere", "UserID='" + Itop.Client.MIS.ProgUID + "' and Col1='2' and Title='" + forecastReport.Title + "'");
// if (listReports.Count > 0)
// {
// pf1.Title = dr["Title"].ToString();
// string[] strtemp = new string [2];
// if (pf1.Title.Contains("����"))
// {
// strtemp[0] = "����";
// strtemp[1] = pf1.Title;
// if(pf1.Title.Substring(pf1.Title.Length-2,2)=="����")
// strtemp[1] = pf1.Title.Substring(0, pf1.Title.Length - 2);
// }
// else if (pf1.Title.Contains("����"))
// {
// strtemp[0] = "����";
// strtemp[1] = pf1.Title;
// if (pf1.Title.Substring(pf1.Title.Length - 2, 2) == "����")
// strtemp[1] = pf1.Title.Substring(0, pf1.Title.Length - 2);
示例2: barButtonItem32_ItemClick
private void barButtonItem32_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
Ps_Forecast_Math psp_Type = new Ps_Forecast_Math();
psp_Type.ForecastID = forecastReport.ID;
psp_Type.Forecast = 0;
IList listTypes = Common.Services.BaseService.GetList("SelectPs_Forecast_MathByForecastIDAndForecast", psp_Type);
IList<Ps_History> fhcol = new List<Ps_History>();
bool flag = false; //�ж���û�� ����������� ����ƽ���¶�
foreach (Ps_Forecast_Math pm in listTypes)
{
if (pm.Title.Contains("���"))
{
Ps_History ph = new Ps_History();
ph.ID = pm.Col1;
ph = (Ps_History)Services.BaseService.GetObject("SelectPs_HistoryByKey", ph);
if (ph!=null)
{
flag = true;
Ps_History pr = new Ps_History();
pr.ID = ph.ParentID;
pr = (Ps_History)Services.BaseService.GetObject("SelectPs_HistoryByKey", pr);
if (pr!=null)
{
ph.Title = pr.Title + ph.Title;
}
fhcol.Add(ph);
}
}
}
if (!flag)
{
MsgBox.Show("Ԥ�������в����ڸ������ݣ��뵼�����ݺ��ٲ�����");
return;
}
//string con = "Title='��ƽ���¶�' AND Col4='" + ProjectUID + "'AND Forecast='1'";
Ps_History wd = (Ps_History)Services.BaseService.GetObject("SelectPs_HistoryByCondition", "Title like'%��ƽ���¶�%' AND Col4='" + Itop.Client.MIS.ProgUID + "'AND Forecast='1'");
if (wd!=null)
{
fhcol.Add(wd);
}
else
{
MsgBox.Show("�ڵ�����չʵ�������趨��ƽ���¶ȣ�");
return;
}
FormForecastWDXS wdxs = new FormForecastWDXS(fhcol);
wdxs.temk1 = temtk1;
wdxs.temk2 = temtk2;
if (wdxs.ShowDialog()==DialogResult.OK)
{
foreach(Ps_History de3 in wdxs.fucol)
{
temtk1 = wdxs.temk1;
temtk2 = wdxs.temk2;
Ps_Forecast_Math py = new Ps_Forecast_Math();
py.Col1 = de3.ID;
py.Forecast = 0;
py.ForecastID = forecastReport.ID;
py = (Ps_Forecast_Math)Services.BaseService.GetObject("SelectPs_Forecast_MathByCol1", py);
if (py != null)
{
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
py.GetType().GetProperty("y" + i).SetValue(py, de3.GetType().GetProperty("y" + i).GetValue(de3, null), null);
}
Services.BaseService.Update<Ps_Forecast_Math>(py);
}
}
}
LoadData();
RefreshChart();
}
示例3: barButtonItem14_ItemClick
private void barButtonItem14_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
FormForecastLoadData2 ffs = new FormForecastLoadData2();
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;
string id = Guid.NewGuid().ToString();
foreach (Ps_History de3 in hs.Values)
{
if (OldHt.ContainsKey(de3.Title))
{
Ps_Forecast_Math py = Common.Services.BaseService.GetOneByKey<Ps_Forecast_Math>(OldHt[de3.Title]);
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
commonhelp.ResetValue(py.ID, "y" + i);
py.GetType().GetProperty("y" + i).SetValue(py, de3.GetType().GetProperty("y" + i).GetValue(de3, null), null);
}
Services.BaseService.Update<Ps_Forecast_Math>(py);
}
else
{
Ps_Forecast_Math ForecastMath = new Ps_Forecast_Math();
ForecastMath.Title = de3.Title;
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
ForecastMath.GetType().GetProperty("y" + i).SetValue(ForecastMath, de3.GetType().GetProperty("y" + i).GetValue(de3, null), null);
}
id = id.Substring(0, 8);
ForecastMath.Col1 = de3.ID;
ForecastMath.ID = id + "|" + de3.ID;
if (de3.ParentID == "")
{
ForecastMath.ParentID = "";
}
else
{
ForecastMath.ParentID = id + "|" + de3.ParentID;
}
ForecastMath.Forecast = type;
ForecastMath.ForecastID = forecastReport.ID;
ForecastMath.Sort = de3.Sort;
Services.BaseService.Create("InsertPs_Forecast_MathbyPs_History", ForecastMath);
}
}
LoadData();
this.chart_user1.All_Select(true);
RefreshChart();
}
示例4: barButtonItem14_ItemClick
/// <summary>
/// ��������
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void barButtonItem14_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
FormForecastLoadData2 ffs = new FormForecastLoadData2();
// ffs.Type = type;
ffs.PID = pid;
ffs.StartYear = forecastReport.StartYear;
ffs.EndYear = forecastReport.EndYear;
if (ffs.ShowDialog() != DialogResult.OK)
return;
Hashtable hs = ffs.HS;
if (hs.Count == 0)
return;
string id = Guid.NewGuid().ToString();
if (New_Flag)
{
foreach (Ps_History de3 in hs.Values)
{
Ps_Forecast_Math py = new Ps_Forecast_Math();
py.Col1 = de3.ID;
py.Forecast = 0;
py.ForecastID = forecastReport.ID;
py = (Ps_Forecast_Math)Services.BaseService.GetObject("SelectPs_Forecast_MathByCol1", py);
if (py == null)
{
Ps_Forecast_Math ForecastMath = new Ps_Forecast_Math();
ForecastMath.Title = de3.Title;
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
ForecastMath.GetType().GetProperty("y" + i).SetValue(ForecastMath, de3.GetType().GetProperty("y" + i).GetValue(de3, null), null);
}
id = id.Substring(0, 8);
ForecastMath.Col1 = de3.ID;
ForecastMath.ID = id + "|" + de3.ID;
ForecastMath.ParentID = id + "|" + de3.ParentID;
ForecastMath.Forecast = 0;
ForecastMath.ForecastID = forecastReport.ID;
ForecastMath.Sort = de3.Sort;
Services.BaseService.Create("InsertPs_Forecast_MathbyPs_History", ForecastMath);
}
else
{
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
py.GetType().GetProperty("y" + i).SetValue(py, de3.GetType().GetProperty("y" + i).GetValue(de3, null), null);
}
Services.BaseService.Update<Ps_Forecast_Math>(py);
}
}
}
else
{
if (ffs.Selectid != "4")
{
foreach (Ps_History de3 in hs.Values)
{
Ps_Forecast_Math py = new Ps_Forecast_Math();
py.Col1 = de3.ID;
py.Forecast = 0;
py.ForecastID = forecastReport.ID;
py = (Ps_Forecast_Math)Services.BaseService.GetObject("SelectPs_Forecast_MathByCol1", py);
if (py == null)
{
Ps_Forecast_Math ForecastMath = new Ps_Forecast_Math();
ForecastMath.Title = de3.Title;
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
ForecastMath.GetType().GetProperty("y" + i).SetValue(ForecastMath, de3.GetType().GetProperty("y" + i).GetValue(de3, null), null);
}
id = id.Substring(0, 8);
ForecastMath.Col1 = de3.ID;
ForecastMath.ID = id + "|" + de3.ID;
ForecastMath.ParentID = id + "|" + de3.ParentID;
ForecastMath.Forecast = 0;
ForecastMath.ForecastID = forecastReport.ID;
ForecastMath.Sort = de3.Sort;
Services.BaseService.Create("InsertPs_Forecast_MathbyPs_History", ForecastMath);
}
else
{
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
//.........这里部分代码省略.........
示例5: updateAllPan
private void updateAllPan(Ps_Forecast_Math psp_TypePan, Ps_forecast_list listReports)
{
string strtemp = "";
if (psp_TypePan.Forecast == 2)
{
strtemp = " and Title!='ͬʱ��'";
}
else
if (psp_TypePan.Forecast == 3)
{
strtemp = "";
}
IList<Ps_Forecast_Math> mathlist = Common.Services.BaseService.GetList<Ps_Forecast_Math>("SelectPs_Forecast_MathByWhere",
"Forecast='" + psp_TypePan.Forecast + "' and ForecastID='" + psp_TypePan.ForecastID + "' and ParentID='" + psp_TypePan.ID + "'" + strtemp+" order by sort desc");
Ps_Forecast_Math matcgui ;
Ps_Forecast_Math matdyh;
Ps_Forecast_Math mattsl;
//if (psp_TypePan.Title.Contains("���غϼ�"))
//{
matcgui = new Ps_Forecast_Math();//����
matdyh = new Ps_Forecast_Math();//���û�
mattsl = new Ps_Forecast_Math();//ͬʱ��
//}
double value = 0;
double value2 = 0;
for (int i = listReports.StartYear; i <= listReports.EndYear; i++)
{
value = 0;
value2 = 0;
foreach (Ps_Forecast_Math mat in mathlist)
{
if (psp_TypePan.Title.Contains("���غϼ�") && (mat.Title.Contains("����") || mat.Title.Contains("���û�") || mat.Title.Contains("ͬʱ��")))
{
if (mat.Title.Contains("����"))
{
matcgui = mat;
}
else
if (mat.Title.Contains("���û�"))
{
matdyh = mat;
}
else
if (mat.Title.Contains("ͬʱ��"))
{
mattsl = mat;
}
if (!mat.Title.Contains("ͬʱ��"))
continue;
}
if (mat.Title == "ͬʱ��")
value2 = value2 * Math.Round(Convert.ToDouble( mat.GetType().GetProperty("y" + i.ToString()).GetValue(mat, null)),2);
else
value2 += Math.Round(Convert.ToDouble(mat.GetType().GetProperty("y" + i.ToString()).GetValue(mat, null)), 2);
}
value += value2;
psp_TypePan.GetType().GetProperty("y" + i.ToString()).SetValue(psp_TypePan, value, null);
Common.Services.BaseService.Update<Ps_Forecast_Math>(psp_TypePan);
}
if (psp_TypePan.ParentID != "")
{
psp_TypePan = Common.Services.BaseService.GetOneByKey<Ps_Forecast_Math>(psp_TypePan.ParentID);
updateAllPan(psp_TypePan, listReports);
}
else
if (psp_TypePan.Title.Contains("���غϼ�"))
{
value = 0;
value2 = 0;
for (int i = listReports.StartYear; i <= listReports.EndYear; i++)
{
value2 = Math.Round(Convert.ToDouble(mattsl.GetType().GetProperty("y" + i.ToString()).GetValue(mattsl, null)),2);
if ( psp_TypePan.Forecast==3)
{
if(value2 != 0 )
{
value2=Math.Round(Convert.ToDouble(psp_TypePan.GetType().GetProperty("y" + i.ToString()).GetValue(psp_TypePan, null)),2)/value2;
value=value2-Math.Round(Convert.ToDouble(matdyh.GetType().GetProperty("y" + i.ToString()).GetValue(matdyh, null)),2);
matcgui.GetType().GetProperty("y" + i.ToString()).SetValue(matcgui, value, null);
Common.Services.BaseService.Update<Ps_Forecast_Math>(matcgui);
}
}
else
if (psp_TypePan.Forecast == 2)
{
value2 =Math.Round(Convert.ToDouble(psp_TypePan.GetType().GetProperty("y" + i.ToString()).GetValue(psp_TypePan, null)),2 );
value = value2 -Math.Round( Convert.ToDouble(matdyh.GetType().GetProperty("y" + i.ToString()).GetValue(matdyh, null)),2);
matcgui.GetType().GetProperty("y" + i.ToString()).SetValue(matcgui, value, null);
Common.Services.BaseService.Update<Ps_Forecast_Math>(matcgui);
}
}
}
}
示例6: Save
private void Save()
{
//����
foreach (DataRow dataRow in dataTable.Rows)
{
TreeListNode row = treeList1.FindNodeByKeyID(dataRow["ID"]);
//for (int i = 0; i < this.treeList1.Nodes.Count; i++)
//{
// TreeListNode row = this.treeList1.Nodes[i];
Ps_Forecast_Math v = new Ps_Forecast_Math();
v.ID = row["ID"].ToString();
foreach (TreeListColumn col in this.treeList1.Columns)
{
if (col.FieldName.IndexOf("y") > -1)
{
object obj = row[col.FieldName];
if (obj != DBNull.Value)
{
v.GetType().GetProperty(col.FieldName).SetValue(v, obj, null);
}
}
}
v.Col4 = "yes";
try
{
Services.BaseService.Update("UpdatePs_Forecast_MathByID", v);
}
catch { }
}
MsgBox.Show("����ɹ���");
}
示例7: barButtonItem1_ItemClick_1
/// <summary>
/// 读取原始数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void barButtonItem1_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
FormForecastLoadData2 ffs = new FormForecastLoadData2();
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;
string id = Guid.NewGuid().ToString();
if (ffs.Selectid != "4")
{
foreach (Ps_History de3 in hs.Values)
{
if (OldHt.ContainsKey(de3.Title))
{
Ps_Forecast_Math py = Common.Services.BaseService.GetOneByKey<Ps_Forecast_Math>(OldHt[de3.Title]);
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
commonhelp.ResetValue(py.ID, "y" + i);
py.GetType().GetProperty("y" + i).SetValue(py, de3.GetType().GetProperty("y" + i).GetValue(de3, null), null);
}
Services.BaseService.Update<Ps_Forecast_Math>(py);
}
else
{
Ps_Forecast_Math ForecastMath = new Ps_Forecast_Math();
ForecastMath.Title = de3.Title;
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
ForecastMath.GetType().GetProperty("y" + i).SetValue(ForecastMath, de3.GetType().GetProperty("y" + i).GetValue(de3, null), null);
}
id = id.Substring(0, 8);
ForecastMath.Col1 = de3.ID;
ForecastMath.ID = id + "|" + de3.ID;
if (de3.ParentID == "")
{
ForecastMath.ParentID = "";
}
else
{
ForecastMath.ParentID = id + "|" + de3.ParentID;
}
ForecastMath.Forecast = type;
ForecastMath.ForecastID = forecastReport.ID;
ForecastMath.Sort = de3.Sort;
Services.BaseService.Create("InsertPs_Forecast_MathbyPs_History", ForecastMath);
}
}
}
else if (ffs.Selectid == "4")
{
foreach (PSP_Types de3 in hs.Values)
{
Ps_Forecast_Math py = new Ps_Forecast_Math();
//py = (Ps_Forecast_Math)Services.BaseService.GetObject("SelectPs_Forecast_MathByWhere", "Title='" + de3.Title + "'" + " and Forecast='0' and ForecastID='" + forecastReport.ID + "' and Col1='"+de3.ID+"'");
py = (Ps_Forecast_Math)Services.BaseService.GetObject("SelectPs_Forecast_MathByWhere", " Forecast = '" + type + "' and ForecastID='" + forecastReport.ID + "' and Col1='" + de3.ID + "'");
if (py == null)
{
Ps_Forecast_Math ForecastMath = new Ps_Forecast_Math();
IList<PSP_Values> listValues = Common.Services.BaseService.GetList<PSP_Values>("SelectPSP_ValuesByWhere", "TypeID='" + de3.ID + "'");
foreach (PSP_Values value in listValues)
{
ForecastMath.GetType().GetProperty("y" + value.Year).SetValue(ForecastMath, value.Value, null);
}
id = id.Substring(0, 8);
ForecastMath.Title = de3.Title;
ForecastMath.Col1 = de3.ID.ToString();
ForecastMath.ID = id + "|" + de3.ID;
ForecastMath.ParentID = id + "|" + de3.ParentID;
ForecastMath.Forecast = type;
ForecastMath.ForecastID = forecastReport.ID;
object obj = Services.BaseService.GetObject("SelectPs_Forecast_MathMaxID", null);
if (obj != null)
ForecastMath.Sort = ((int)obj) + 1;
else
ForecastMath.Sort = 1;
Services.BaseService.Create("InsertPs_Forecast_MathbyPs_History", ForecastMath);
}
else
//.........这里部分代码省略.........
示例8: barButtonItem1_ItemClick
//.........这里部分代码省略.........
// pcs1.ForecastID = forecastReport.ID;
// pcs1.CalcID = dataRow["ID"].ToString();
// pcs1.Value1 = zzl;
// pcs.Value2 = Convert.ToDouble(comboBox4.SelectedItem.ToString().Replace("��", ""));
// pcs.Value3 = Convert.ToDouble(comboBox5.SelectedItem.ToString().Replace("��", ""));
// pcs.Value4 = Convert.ToDouble(dr["B"].ToString().Replace("%", ""));
// pcs.Col1 = comboBox1.SelectedItem.ToString();
// Services.BaseService.Create<Ps_Calc>(pcs1);
// }
//}
if (syear != 0 && eyear != 0)
{
double value1 = 0;
double value2 = 0;
double value3 = 0;
foreach (Ps_Forecast_Math ms in list)
{
// value1 = (double)dataRow["y" + (i )];
// value1 = (double)dataRow["y" + (i )];
if (ms.Title.Contains("����"))
{
pfscgui = ms;
}
}
for (int i = syear; i <= eyear; i++)
{
try
{
foreach (Ps_Forecast_Math ms in list)
{
// value1 = (double)dataRow["y" + (i )];
// value1 = (double)dataRow["y" + (i )];
if (ms.Title.Contains("����"))
{
value1 = Math.Round(Convert.ToDouble(ms.GetType().GetProperty("y" + (i-1)).GetValue(ms, null)), 2);
pfscgui = ms;
}
else
if (ms.Title.Contains("���û�"))
value2 = Math.Round(Convert.ToDouble(ms.GetType().GetProperty("y" + (i )).GetValue(ms, null)), 2);
else
if (ms.Title.Contains("ͬʱ��"))
value3 = Math.Round(Convert.ToDouble(ms.GetType().GetProperty("y" + (i )).GetValue(ms, null)), 2);
}
}
catch { }
value1 = Math.Round(value1 * (1 + zzl * 0.01), 2);
pfscgui.GetType().GetProperty("y" + (i)).SetValue(pfscgui, value1, null);
Common.Services.BaseService.Update<Ps_Forecast_Math>(pfscgui);
}
}
}
if (!v.Title.Contains("ȫ���"))
{
v = Common.Services.BaseService.GetOneByKey<Ps_Forecast_Math>(v.ParentID);
updateAllPan(v, listReports[0]);
}
//////////////����
//string strtemp = "";
//if (typetemp==2)
//{
// strtemp = " and Title!='ͬʱ��'";
//}
//else
// if (typetemp == 3)
// {
// strtemp = "";
// }
//IList<Ps_Forecast_Math> mathlist = Common.Services.BaseService.GetList<Ps_Forecast_Math>("SelectPs_Forecast_MathByWhere",
// "Forecast='" + typetemp + "' and ForecastID='" + listReports[0].ID + "' and ParentID='" + psp_TypePan.ID + "'" + strtemp);
//double value = 0;
//for (int i = listReports[0].StartYear; i < listReports[0].EndYear; i++)
//{
// value = 0;
// foreach (Ps_Forecast_Math mat in mathlist)
// {
// if (mat.Title=="ͬʱ��")
// value*= (double)mat.GetType().GetProperty("y" + i.ToString()).GetValue(mat, null);
// else
// value += (double)mat.GetType().GetProperty("y" + i.ToString()).GetValue(mat, null);
// }
// psp_TypePan.GetType().GetProperty("y" + i.ToString()).SetValue(psp_TypePan, value, null);
// Common.Services.BaseService.Update<Ps_Forecast_Math>(psp_TypePan);
//}
}
wait.Close();
MessageBox.Show("���³ɹ���");
}
}
示例9: UpdateSpatataldata
public void UpdateSpatataldata(string TypeTitle)
{
TreeListNode row = this.treeList1.FocusedNode;
if (row == null)
{
return;
}
glebeProperty gp = new glebeProperty();
gp.ParentEleID = "0";
gp.SvgUID = "c5ec3bc7-9706-4cbd-9b8b-632d3606f933";
gp.ObligateField16 = TypeTitle;
IList<glebeProperty> svglist = Services.BaseService.GetList<glebeProperty>("SelectglebePropertyByObligateField16", gp);
//重新对选中的数据进行更新
Ps_Forecast_Math psp_Type = new Ps_Forecast_Math();
ForecastClass1.TreeNodeToDataObject<Ps_Forecast_Math>(psp_Type, row);
IList<glebeYearValue> yearlist = Services.BaseService.GetList<glebeYearValue>("SelectglebeYearValueBywhere", "ParentID='" + svglist[0].UID + "'");
for (int i = 0; i < yearlist.Count; i++)
{
string y = "y" + yearlist[i].Year.ToString();
psp_Type.GetType().GetProperty(y).SetValue(psp_Type, yearlist[i].Burthen, null);
}
try
{
Common.Services.BaseService.Update<Ps_Forecast_Math>(psp_Type);
//psp_Type.ID = (int)Common.Services.BaseService.Create("InsertPSP_P_Types", psp_Type);
//dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(psp_Type, dataTable.NewRow()));
LoadData();
//treeList1.EndUpdate();
RefreshChart();
}
catch (Exception ex)
{
}
}
示例10: barButtonItem2_ItemClick
private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
TreeListNode row = this.treeList1.FocusedNode;
if (row == null) {
return;
}
string parentid = row["ParentID"].ToString();
// FormTypeTitle frm = new FormTypeTitle();
string TypeTitle = row["Title"].ToString();
frmMain_Spatial fmain = new frmMain_Spatial();
frmMain_Spatial.MapType = "接线图";
frmMain_Spatial.progtype = "城市规划层";
string pid = "";
fmain.Show();
string progtype = "城市规划层";
//if (progtype == "地理信息层") {
// fmain.ViewMenu();
//}
if (pid == "") {
fmain.Open("c5ec3bc7-9706-4cbd-9b8b-632d3606f933","");
} else {
fmain.Open("c5ec3bc7-9706-4cbd-9b8b-632d3606f933", pid);
}
// LoadImage = true;
fmain.InitShape();
fmain.Init(progtype);
fmain.InitScaleRatio();
fmain.LayerManagerShow();
fmain.OpenGHQYpropetty(TypeTitle);
if (fmain.DialogResult == DialogResult.OK)
{
glebeProperty gp = new glebeProperty();
gp.ParentEleID = "0";
gp.SvgUID = "c5ec3bc7-9706-4cbd-9b8b-632d3606f933";
gp.ObligateField16 = TypeTitle;
IList<glebeProperty> svglist = Services.BaseService.GetList<glebeProperty>("SelectglebePropertyByObligateField16", gp);
//重新对选中的数据进行更新
Ps_Forecast_Math psp_Type = new Ps_Forecast_Math();
ForecastClass1.TreeNodeToDataObject<Ps_Forecast_Math>(psp_Type, row);
IList<glebeYearValue> yearlist = Services.BaseService.GetList<glebeYearValue>("SelectglebeYearValueBywhere", "ParentID='" + svglist[0].UID + "'");
for (int i = 0; i < yearlist.Count; i++)
{
string y = "y" + yearlist[i].Year.ToString();
psp_Type.GetType().GetProperty(y).SetValue(psp_Type, yearlist[i].Burthen, null);
}
try
{
Common.Services.BaseService.Update<Ps_Forecast_Math>(psp_Type);
//psp_Type.ID = (int)Common.Services.BaseService.Create("InsertPSP_P_Types", psp_Type);
//dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(psp_Type, dataTable.NewRow()));
LoadData();
//treeList1.EndUpdate();
RefreshChart();
}
catch (Exception ex)
{
}
}
else
{
//MsgBox.Show("在规划地块中,没有圈选此区域,请在规划地块模块中圈选此地块再点击编辑!");
fmain.Owner = this;
}
}
示例11: barButtonItem1_ItemClick
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
FrmAddspatialarea FA = new FrmAddspatialarea();
FA.init();
if (FA.ShowDialog()==DialogResult.OK)
{
foreach (DataRow dr in dataTable.Rows)
{
if (dr["Title"]==FA.Areatitle)
{
MessageBox.Show("已经存在此地区!请重新选。");
return;
}
}
glebeProperty gp = new glebeProperty();
gp.ParentEleID = "0";
gp.SvgUID = "c5ec3bc7-9706-4cbd-9b8b-632d3606f933";
gp.ObligateField16 = FA.Areatitle;
IList<glebeProperty> svglist = Services.BaseService.GetList<glebeProperty>("SelectglebePropertyByObligateField16", gp);
if (svglist.Count>0)
{
frmMainProperty f = new frmMainProperty();
f.IsReadonly = true;
f.InitData(svglist[0], "", "","");
if (f.ShowDialog()==DialogResult.OK)
{
Ps_Forecast_Math psp_Type = new Ps_Forecast_Math();
psp_Type.ID = Guid.NewGuid().ToString();
psp_Type.Forecast = type;
psp_Type.ForecastID = forecastReport.ID;
psp_Type.Title = FA.Areatitle;
glebeYearValue gy = new glebeYearValue();
IList<glebeYearValue> yearlist = Services.BaseService.GetList<glebeYearValue>("SelectglebeYearValueBywhere", "ParentID='" + svglist[0].UID + "'");
for (int i = 0; i < yearlist.Count;i++ ) {
string y = "y" + yearlist[i].Year.ToString();
psp_Type.GetType().GetProperty(y).SetValue(psp_Type, yearlist[i].Burthen, null);
}
object obj = Services.BaseService.GetObject("SelectPs_Forecast_MathMaxID", null);
if (obj != null)
psp_Type.Sort = ((int)obj) + 1;
else
psp_Type.Sort = 1;
try {
Common.Services.BaseService.Create<Ps_Forecast_Math>(psp_Type);
//psp_Type.ID = (int)Common.Services.BaseService.Create("InsertPSP_P_Types", psp_Type);
dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(psp_Type, dataTable.NewRow()));
} catch (Exception ex) {
MsgBox.Show("增加区域出错:" + ex.Message);
}
RefreshChart();
}
}
else
{
Ps_Forecast_Math psp_Type = new Ps_Forecast_Math();
psp_Type.ID = Guid.NewGuid().ToString();
psp_Type.Forecast = type;
psp_Type.ForecastID = forecastReport.ID;
psp_Type.Title = FA.Areatitle;
//glebeYearValue gy = new glebeYearValue();
//IList<glebeYearValue> yearlist = Services.BaseService.GetList<glebeYearValue>("SelectglebeYearValueBywhere", "ParentID='" + svglist[0].UID + "'");
//for (int i = 0; i < yearlist.Count; i++) {
// string y = "y" + yearlist[i].Year.ToString();
// psp_Type.GetType().GetProperty(y).SetValue(psp_Type, y, null);
//}
object obj = Services.BaseService.GetObject("SelectPs_Forecast_MathMaxID", null);
if (obj != null)
psp_Type.Sort = ((int)obj) + 1;
else
psp_Type.Sort = 1;
try {
Common.Services.BaseService.Create<Ps_Forecast_Math>(psp_Type);
//psp_Type.ID = (int)Common.Services.BaseService.Create("InsertPSP_P_Types", psp_Type);
dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(psp_Type, dataTable.NewRow()));
} catch (Exception ex) {
MsgBox.Show("增加区域出错:" + ex.Message);
}
RefreshChart();
}
}
}
示例12: barButtonItem18_ItemClick
private void barButtonItem18_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
TreeListNode tln = treeList1.FocusedNode;
if (tln == null)
return;
if (tln.ParentNode != null)
return;
FormForecastLoadData ffs = new FormForecastLoadData();
ffs.PID = Itop.Client.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;
string id = Guid.NewGuid().ToString();
if (ffs.Selectid != "4")
{
foreach (Ps_History de3 in hs.Values)
{
Ps_Forecast_Math py = new Ps_Forecast_Math();
py.Col1 = de3.ID;
py.Forecast = 3;
py.ForecastID = forecastReport.ID;
py = (Ps_Forecast_Math)Services.BaseService.GetObject("SelectPs_Forecast_MathByCol1", py);
if (py == null)
{
Ps_Forecast_Math ForecastMath = new Ps_Forecast_Math();
ForecastMath.Title = de3.Title;
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
ForecastMath.GetType().GetProperty("y" + i).SetValue(ForecastMath, de3.GetType().GetProperty("y" + i).GetValue(de3, null), null);
}
id = id.Substring(0, 8);
ForecastMath.Col1 = de3.ID;
ForecastMath.ID = id + "|" + de3.ID;
ForecastMath.ParentID = tln["ID"].ToString();
ForecastMath.Forecast = 3;
ForecastMath.ForecastID = forecastReport.ID;
ForecastMath.Sort = de3.Sort;
Services.BaseService.Create("InsertPs_Forecast_MathbyPs_History", ForecastMath);
}
else
{
for (int i = forecastReport.StartYear; i <= forecastReport.EndYear; i++)
{
py.GetType().GetProperty("y" + i).SetValue(py, de3.GetType().GetProperty("y" + i).GetValue(de3, null), null);
}
Services.BaseService.Update<Ps_Forecast_Math>(py);
}
}
}
LoadData();
}
示例13: BadForecast
public void BadForecast(int type, Ps_forecast_list forecastReport)
{
Ps_Forecast_Math psp_Type = new Ps_Forecast_Math();
psp_Type.ForecastID = forecastReport.ID;
psp_Type.Forecast = type;
Common.Services.BaseService.Update("DeletePs_Forecast_MathForecastIDAndForecast", psp_Type);
psp_Type.Forecast = 0;
IList listTypes = Common.Services.BaseService.GetList("SelectPs_Forecast_MathByForecastIDAndForecast", psp_Type);
foreach (Ps_Forecast_Math psp_Typetemp in listTypes)
{
string id = psp_Typetemp.ID;
psp_Type = new Ps_Forecast_Math();
psp_Type = psp_Typetemp;
psp_Type.ID = type + "|" + id;// Guid.NewGuid().ToString();
psp_Type.Forecast = type;
psp_Type.Col1 = id;
psp_Type.ParentID = type + "|" + psp_Typetemp.ParentID;
Ps_BadData pb1 = new Ps_BadData();
pb1.ForecastID = psp_Typetemp.ForecastID;
pb1.Forecast = 1;
pb1.Col1 = id;
Ps_BadData pb = new Ps_BadData();
IList<Ps_BadData> li = Common.Services.BaseService.GetList<Ps_BadData>("SelectPs_BadDataByCol1", pb1);
if (li.Count > 0)
{
pb = li[0];
for(int i=forecastReport.StartYear;i<forecastReport.EndYear;i++)
{
double dl = 0;
double dl1 = 0;
PropertyInfo pi = psp_Type.GetType().GetProperty("y" + i);
PropertyInfo pi1 = pb.GetType().GetProperty("y" + i);
try
{
dl = Convert.ToDouble(pi.GetValue(psp_Type, null));
}
catch(Exception ex)
{
int b = 1;
b++;
}
try
{
dl1 = Convert.ToDouble(pi1.GetValue(pb, null));
}
catch (Exception ex)
{
int b = 1;
b++;
}
if(dl1!=0)
pi.SetValue(psp_Type, dl + dl1, null);
}
}
Common.Services.BaseService.Create<Ps_Forecast_Math>(psp_Type);
}
}