private void simpleButton5_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(devObj.Title)) { MessageBox.Show("名称不能为空!"); return; } if (string.IsNullOrEmpty(devObj.S3)) { MessageBox.Show("请选择投产时间!"); return; } if (Convert.ToDouble(spinEdit1.Value) == 0) { MessageBox.Show("请填写电压等级!"); return; } PSP_PowerSubstation_Info obj = UCDeviceBase.DataService.GetOneByKey <PSP_PowerSubstation_Info>(DeviceMx); if (obj == null) { UCDeviceBase.DataService.Create <PSP_PowerSubstation_Info>(DeviceMx); } double rl = 0; int bts = 0; frmDeviceManager_children frmc = new frmDeviceManager_children(); frmc.ParentObj = DeviceMx; string[] types = new string[] { "01", "02", "04" }; frmc.childrendevice(types); if (frmc.DialogResult == DialogResult.OK) { string where = "where projectid='" + Itop.Client.MIS.ProgUID + "'and type='04'and SvgUID='" + DeviceMx.UID + "'"; IList <PSPDEV> list = Services.BaseService.GetList <PSPDEV>("SelectPSPDEVByCondition", where); foreach (PSPDEV pd in list) { if (!string.IsNullOrEmpty(pd.OperationYear) && !string.IsNullOrEmpty(pd.Date2) && pd.Date2.Length == 4 && !string.IsNullOrEmpty(DeviceMx.S29) && !string.IsNullOrEmpty(DeviceMx.S30)) { if (Convert.ToInt32(pd.OperationYear) >= Convert.ToInt32(DeviceMx.S29) && Convert.ToInt32(pd.Date2) <= Convert.ToInt32(DeviceMx.S30)) { rl += pd.P0; bts++; } } else { rl += pd.P0; bts++; } } if (list.Count > 0) { spinEdit2.Value = (decimal)rl; } } }
private void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e) { int ihand = gridView1.FocusedRowHandle; if (ihand < 0) { return; } DataRow dr = gridView1.GetDataRow(ihand); PSP_PowerSubstation_Info pj = Itop.Common.DataConverter.RowToObject <PSP_PowerSubstation_Info>(dr); double rl = 0; int bts = 0; frmDeviceManager_children frmc = new frmDeviceManager_children(); frmc.ParentObj = pj; string[] types = new string[] { "01", "02", "04" }; frmc.childrendevice(types); if (frmc.DialogResult == DialogResult.OK) { string where = "where projectid='" + Itop.Client.MIS.ProgUID + "'and type='04'and SvgUID='" + pj.UID + "'"; IList <PSPDEV> list = UCDeviceBase.DataService.GetList <PSPDEV>("SelectPSPDEVByCondition", where); foreach (PSPDEV pd in list) { if (!string.IsNullOrEmpty(pd.OperationYear) && !string.IsNullOrEmpty(pd.Date2) && pd.Date2.Length == 4 && !string.IsNullOrEmpty(pj.S30) && !string.IsNullOrEmpty(pj.S29)) { if (Convert.ToInt32(pd.OperationYear) >= Convert.ToInt32(pj.S29) && Convert.ToInt32(pd.Date2) <= Convert.ToInt32(pj.S30)) { rl += pd.P0; bts++; } } else { rl += pd.P0; bts++; } } if (rl != 0) { pj.S2 = rl.ToString(); dr["S2"] = rl.ToString(); } UCDeviceBase.DataService.Update <PSP_PowerSubstation_Info>(pj); } }
private void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e) { int ihand = gridView1.FocusedRowHandle; if (ihand < 0) return; DataRow dr = gridView1.GetDataRow(ihand); PSP_Substation_Info pj = Itop.Common.DataConverter.RowToObject<PSP_Substation_Info>(dr); double rl = 0; int bts = 0; frmDeviceManager_children frmc = new frmDeviceManager_children(); frmc.ParentObj = pj; string[] types = new string[] { "01", "02","03", "12" }; frmc.childrendevice(types); if (frmc.DialogResult == DialogResult.OK) { string rlgc = ""; string where = "where projectid='" + Itop.Client.MIS.ProgUID + "'and type in ('02','03')and SvgUID='" + pj.UID + "'"; IList<PSPDEV> list = UCDeviceBase.DataService.GetList<PSPDEV>("SelectPSPDEVByCondition", where); foreach (PSPDEV pd in list) { if (!string.IsNullOrEmpty(pd.OperationYear) && !string.IsNullOrEmpty(pd.Date2) && pd.Date2.Length == 4 && !string.IsNullOrEmpty(pj.L29) && !string.IsNullOrEmpty(pj.L28)) { if (Convert.ToInt32(pd.OperationYear) >= Convert.ToInt32(pj.L28) && Convert.ToInt32(pd.Date2) <= Convert.ToInt32(pj.L29)) { if (pd.Type == "03") { rl += pd.SiN; rlgc += pd.SiN.ToString("G") + "+"; } else { rl += (double)pd.Burthen; rlgc += ((double)pd.Burthen).ToString("G") + "+"; } bts++; } } else { if (pd.Type == "03") { rl += pd.SiN; rlgc += pd.SiN.ToString("G") + "+"; } else { rl += (double)pd.Burthen; rlgc += ((double)pd.Burthen).ToString("G") + "+"; } bts++; } } if (rlgc.Length > 0) { pj.L4 = rlgc.Substring(0, rlgc.Length - 1); dr["L4"] = pj.L4; } if (rl!=0) { pj.L2 = rl; pj.L3 = bts; dr["L2"] = rl; dr["L3"] = bts; } UCDeviceBase.DataService.Update<PSP_Substation_Info>(pj); } }
private void simpleButton5_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textEdit1.Text)) { MessageBox.Show("变电站名称不能为空!"); return; } if (string.IsNullOrEmpty(comboBoxEdit1.Text)) { MessageBox.Show("请选择投产时间!"); return; } if ((int)spinEdit1.Value == 0) { MessageBox.Show("请填写电压等级!"); return; } PSP_Substation_Info obj = UCDeviceBase.DataService.GetOneByKey <PSP_Substation_Info>(DeviceMx); if (obj == null) { bcflag = true; UCDeviceBase.DataService.Create <PSP_Substation_Info>(DeviceMx); } double rl = 0; int bts = 0; frmDeviceManager_children frmc = new frmDeviceManager_children(); frmc.ParentObj = DeviceMx; string[] types = new string[] { "01", "02", "03", "12" }; frmc.childrendevice(types); if (frmc.DialogResult == DialogResult.OK) { string rlgc = ""; string where = "where projectid='" + Itop.Client.MIS.ProgUID + "'and type in ('02','03')and SvgUID='" + DeviceMx.UID + "'"; IList <PSPDEV> list = Services.BaseService.GetList <PSPDEV>("SelectPSPDEVByCondition", where); foreach (PSPDEV pd in list) { if (!string.IsNullOrEmpty(pd.OperationYear) && !string.IsNullOrEmpty(pd.Date2) && pd.Date2.Length == 4 && !string.IsNullOrEmpty(bdz.L29) && !string.IsNullOrEmpty(bdz.L28)) { if (Convert.ToInt32(pd.OperationYear) >= Convert.ToInt32(bdz.L28) && Convert.ToInt32(pd.Date2) <= Convert.ToInt32(bdz.L29)) { if (pd.Type == "03") { rl += pd.SiN; rlgc += pd.SiN.ToString() + "+"; } else { rl += (double)pd.Burthen; rlgc += ((double)pd.Burthen).ToString() + "+"; } bts++; } } else { if (pd.Type == "03") { rl += pd.SiN; rlgc += pd.SiN.ToString() + "+"; } else { rl += (double)pd.Burthen; rlgc += ((double)pd.Burthen).ToString() + "+"; } bts++; } } if (list.Count > 0) { if (rlgc.Length > 0) { textEdit2.Text = rlgc.Substring(0, rlgc.Length - 1); } if (rl != 0) { spinEdit2.Value = (decimal)rl; spinEdit4.Value = (decimal)bts; } } } }
private void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e) { int ihand = gridView1.FocusedRowHandle; if (ihand < 0) return; DataRow dr = gridView1.GetDataRow(ihand); PSP_PowerSubstation_Info pj = Itop.Common.DataConverter.RowToObject<PSP_PowerSubstation_Info>(dr); double rl = 0; int bts = 0; frmDeviceManager_children frmc = new frmDeviceManager_children(); frmc.ParentObj = pj; string[] types = new string[] { "01", "02", "04" }; frmc.childrendevice(types); if (frmc.DialogResult == DialogResult.OK) { string where = "where projectid='" + Itop.Client.MIS.ProgUID + "'and type='04'and SvgUID='" + pj.UID + "'"; IList<PSPDEV> list = UCDeviceBase.DataService.GetList<PSPDEV>("SelectPSPDEVByCondition", where); foreach (PSPDEV pd in list) { if (!string.IsNullOrEmpty(pd.OperationYear) && !string.IsNullOrEmpty(pd.Date2) && pd.Date2.Length == 4 && !string.IsNullOrEmpty(pj.S30) && !string.IsNullOrEmpty(pj.S29)) { if (Convert.ToInt32(pd.OperationYear) >= Convert.ToInt32(pj.S29) && Convert.ToInt32(pd.Date2) <= Convert.ToInt32(pj.S30)) { rl += pd.P0; bts++; } } else { rl += pd.P0; bts++; } } if (rl!=0) { pj.S2 = rl.ToString(); dr["S2"] = rl.ToString(); } UCDeviceBase.DataService.Update<PSP_PowerSubstation_Info>(pj); } }
private void simpleButton5_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textEdit1.Text)) { MessageBox.Show("���վ���Ʋ���Ϊ�գ�"); return; } if (string.IsNullOrEmpty(comboBoxEdit1.Text)) { MessageBox.Show("��ѡ��Ͷ��ʱ�䣡"); return; } if ((int)spinEdit1.Value == 0) { MessageBox.Show("����д��ѹ�ȼ���"); return; } PSP_Substation_Info obj = UCDeviceBase.DataService.GetOneByKey<PSP_Substation_Info>(DeviceMx); if (obj==null) { bcflag = true; UCDeviceBase.DataService.Create<PSP_Substation_Info>(DeviceMx); } double rl = 0; int bts = 0; frmDeviceManager_children frmc = new frmDeviceManager_children(); frmc.ParentObj = DeviceMx; string[] types=new string[]{"01","02","03","12"}; frmc.childrendevice(types); if (frmc.DialogResult==DialogResult.OK) { string rlgc = ""; string where = "where projectid='" + Itop.Client.MIS.ProgUID + "'and type in ('02','03')and SvgUID='"+DeviceMx.UID+"'"; IList<PSPDEV> list = Services.BaseService.GetList<PSPDEV>("SelectPSPDEVByCondition", where); foreach (PSPDEV pd in list) { if (!string.IsNullOrEmpty(pd.OperationYear) && !string.IsNullOrEmpty(pd.Date2) && pd.Date2.Length == 4 && !string.IsNullOrEmpty(bdz.L29) && !string.IsNullOrEmpty(bdz.L28)) { if (Convert.ToInt32(pd.OperationYear) >= Convert.ToInt32(bdz.L28) && Convert.ToInt32(pd.Date2) <= Convert.ToInt32(bdz.L29)) { if (pd.Type == "03") { rl += pd.SiN; rlgc += pd.SiN.ToString() + "+"; } else { rl += (double)pd.Burthen; rlgc += ((double)pd.Burthen).ToString() + "+"; } bts++; } } else { if (pd.Type == "03") { rl += pd.SiN; rlgc += pd.SiN.ToString() + "+"; } else { rl += (double)pd.Burthen; rlgc += ((double)pd.Burthen).ToString() + "+"; } bts++; } } if (list.Count>0) { if (rlgc.Length>0) { textEdit2.Text = rlgc.Substring(0, rlgc.Length - 1); } if (rl!=0) { spinEdit2.Value = (decimal)rl; spinEdit4.Value = (decimal)bts; } } } }
private void simpleButton5_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(devObj.Title)) { MessageBox.Show("���Ʋ���Ϊ�գ�"); return; } if (string.IsNullOrEmpty(devObj.S3)) { MessageBox.Show("��ѡ��Ͷ��ʱ�䣡"); return; } if (Convert.ToDouble(spinEdit1.Value) == 0) { MessageBox.Show("����д��ѹ�ȼ���"); return; } PSP_PowerSubstation_Info obj = UCDeviceBase.DataService.GetOneByKey<PSP_PowerSubstation_Info>(DeviceMx); if (obj==null) { UCDeviceBase.DataService.Create<PSP_PowerSubstation_Info>(DeviceMx); } double rl = 0; int bts = 0; frmDeviceManager_children frmc = new frmDeviceManager_children(); frmc.ParentObj = DeviceMx; string[] types = new string[] { "01", "02", "04" }; frmc.childrendevice(types); if (frmc.DialogResult==DialogResult.OK) { string where = "where projectid='" + Itop.Client.MIS.ProgUID + "'and type='04'and SvgUID='" + DeviceMx.UID + "'"; IList<PSPDEV> list = Services.BaseService.GetList<PSPDEV>("SelectPSPDEVByCondition", where); foreach (PSPDEV pd in list) { if (!string.IsNullOrEmpty(pd.OperationYear) && !string.IsNullOrEmpty(pd.Date2) && pd.Date2.Length == 4 && !string.IsNullOrEmpty(DeviceMx.S29) && !string.IsNullOrEmpty(DeviceMx.S30)) { if (Convert.ToInt32(pd.OperationYear) >= Convert.ToInt32(DeviceMx.S29) && Convert.ToInt32(pd.Date2) <= Convert.ToInt32(DeviceMx.S30)) { rl +=pd.P0; bts++; } } else { rl += pd.P0; bts++; } } if (list.Count>0) { spinEdit2.Value = (decimal)rl; } } }
private void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e) { int ihand = gridView1.FocusedRowHandle; if (ihand < 0) { return; } DataRow dr = gridView1.GetDataRow(ihand); PSP_Substation_Info pj = Itop.Common.DataConverter.RowToObject <PSP_Substation_Info>(dr); double rl = 0; int bts = 0; frmDeviceManager_children frmc = new frmDeviceManager_children(); frmc.ParentObj = pj; string[] types = new string[] { "01", "02", "03", "12" }; frmc.childrendevice(types); if (frmc.DialogResult == DialogResult.OK) { string rlgc = ""; string where = "where projectid='" + Itop.Client.MIS.ProgUID + "'and type in ('02','03')and SvgUID='" + pj.UID + "'"; IList <PSPDEV> list = UCDeviceBase.DataService.GetList <PSPDEV>("SelectPSPDEVByCondition", where); foreach (PSPDEV pd in list) { if (!string.IsNullOrEmpty(pd.OperationYear) && !string.IsNullOrEmpty(pd.Date2) && pd.Date2.Length == 4 && !string.IsNullOrEmpty(pj.L29) && !string.IsNullOrEmpty(pj.L28)) { if (Convert.ToInt32(pd.OperationYear) >= Convert.ToInt32(pj.L28) && Convert.ToInt32(pd.Date2) <= Convert.ToInt32(pj.L29)) { if (pd.Type == "03") { rl += pd.SiN; rlgc += pd.SiN.ToString("G") + "+"; } else { rl += (double)pd.Burthen; rlgc += ((double)pd.Burthen).ToString("G") + "+"; } bts++; } } else { if (pd.Type == "03") { rl += pd.SiN; rlgc += pd.SiN.ToString("G") + "+"; } else { rl += (double)pd.Burthen; rlgc += ((double)pd.Burthen).ToString("G") + "+"; } bts++; } } if (rlgc.Length > 0) { pj.L4 = rlgc.Substring(0, rlgc.Length - 1); dr["L4"] = pj.L4; } if (rl != 0) { pj.L2 = rl; pj.L3 = bts; dr["L2"] = rl; dr["L3"] = bts; } UCDeviceBase.DataService.Update <PSP_Substation_Info>(pj); } }