private void butSysparaSave_Click(object sender, System.EventArgs e) { if (!this.paraCheck()) { return; } if (this.rbBilling1rate.Checked) { float bill_1rate = System.Convert.ToSingle(this.tb1rate.Text); if (Sys_Para.SetBill_ratetype(0) < 0 || Sys_Para.SetBill_1rate(bill_1rate) < 0) { EcoMessageBox.ShowError(this, EcoLanguage.getMsg(LangRes.OPfail, new string[0])); return; } } else { float bill_2rate = System.Convert.ToSingle(this.tb2Rate1.Text); float bill_2rate2 = System.Convert.ToSingle(this.tb2Rate2.Text); string bill_2from = this.dtPicker2from1.Text + ":00:00"; int bill_2duration = System.Convert.ToInt32(this.tbduration.Text); if (Sys_Para.SetBill_ratetype(1) < 0 || Sys_Para.SetBill_2from1(bill_2from) < 0 || Sys_Para.SetBill_2duration1(bill_2duration) < 0 || Sys_Para.SetBill_2rate1(bill_2rate) < 0 || Sys_Para.SetBill_2rate2(bill_2rate2) < 0) { EcoMessageBox.ShowError(this, EcoLanguage.getMsg(LangRes.OPfail, new string[0])); return; } } EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0])); }
private bool userCheck() { string text = this.tbUserNmEdit.Text; if (string.IsNullOrEmpty(text)) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.lbUserNmEdit.Text })); this.tbUserNmEdit.Focus(); return(false); } if (string.IsNullOrEmpty(this.tbUserPwEdit.Text)) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.lbUserPwEdit.Text })); this.tbUserPwEdit.Focus(); return(false); } if (this.tbUserPwEdit.Text != this.tbUserCPwEdit.Text) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.match, new string[] { this.lbUserPwEdit.Text, this.lbUserCPwEdit.Text })); this.tbUserCPwEdit.Focus(); return(false); } return(true); }
private void butSave_Click(object sender, System.EventArgs e) { bool flag = false; Ecovalidate.checkTextIsNull(this.tbIdleTimeOut, ref flag); if (flag) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.lbidletimeout.Text })); return; } if (!Ecovalidate.Rangeint(this.tbIdleTimeOut, 0, 30)) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Range, new string[] { this.lbidletimeout.Text, "0", "30" })); return; } int num = System.Convert.ToInt32(this.tbIdleTimeOut.Text); ValuePairs.setIdleTimeout(num, true); Program.m_IdleTimeSet = num * Program.m_IdleTimeFact; EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0])); base.DialogResult = DialogResult.OK; base.Close(); }
private void butOthDevicesDel_Click(object sender, System.EventArgs e) { if (this.dgvAllOtherDevices.SelectedRows.Count == 0) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Dev_needselect, new string[0])); return; } DialogResult dialogResult = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Dev_delCrm, new string[0]), MessageBoxButtons.OKCancel); if (dialogResult == DialogResult.Cancel) { return; } System.Collections.ArrayList arrayList = new System.Collections.ArrayList(); for (int i = 0; i < this.dgvAllOtherDevices.SelectedRows.Count; i++) { DataGridViewCellCollection cells = this.dgvAllOtherDevices.SelectedRows[i].Cells; string value = cells[4].Value.ToString(); arrayList.Add(value); } progressPopup progressPopup = new progressPopup("Information", 1, EcoLanguage.getMsg(LangRes.PopProgressMsg_delDev, new string[0]), null, new progressPopup.ProcessInThread(this.delGateWayPro), arrayList, 0); progressPopup.ShowDialog(); object return_V = progressPopup.Return_V; int? num = return_V as int?; if (!num.HasValue || num < 0) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0])); } this.changeTreeSelect("DevRoot"); }
private void btnSave_Click(object sender, System.EventArgs e) { string text = Sys_Para.GetBillPath(); if (text.Length == 0) { text = System.IO.Directory.GetCurrentDirectory() + "\\BillReportFile\\"; } System.DateTime now = System.DateTime.Now; int num = this.SaveToFile(text + now.ToString("yyyy-MM-dd HH-mm-ss"), this.m_pParaClass.Txttitle); if (num == -1) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Rpt_saveErr1, new string[0])); return; } if (num == -2) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0])); return; } string str = text + now.ToString("yyyy-MM-dd HH-mm-ss") + "\\" + this.m_pParaClass.Txttitle.Replace("'", "''"); if (ReportInfo.InsertBillReport(this.m_pParaClass.Txttitle, this.m_pParaClass.Txtwriter, now, str + ".html") == 0) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0])); return; } this.m_isRPTSaved = true; EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0])); }
private bool paraoptCheck() { bool flag = false; if (this.cbkeepdata.Checked) { Ecovalidate.checkTextIsNull(this.tbkeepmonths, ref flag); if (flag) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.lbMonths.Text })); return(false); } if (!Ecovalidate.Rangeint(this.tbkeepmonths, 6, 60)) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Range, new string[] { this.lbMonths.Text, "6", "60" })); return(false); } } return(true); }
private void initPage(object obj) { try { System.Threading.Thread.Sleep(500); System.TimeSpan timeout = System.TimeSpan.FromMilliseconds(30000.0); try { ServiceController serviceController = new ServiceController(EcoGlobalVar.gl_ServiceName); serviceController.Start(); serviceController.WaitForStatus(ServiceControllerStatus.Running, timeout); } catch (System.Exception) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.srvFail, new string[0])); } ControlAccess.ConfigControl config = delegate(Control control, object param) { this.enableclose = 1; base.Close(); }; ControlAccess controlAccess = new ControlAccess(this, config); controlAccess.Access(this, null); } catch (System.Exception) { } }
public void pageInit(OtherDevices pParent, string gatewayID, string devName) { this.m_pParent = pParent; this.m_gatewayID = gatewayID; InSnergyGateway gateWaybyGID = InSnergyGateway.GetGateWaybyGID(gatewayID); if (gateWaybyGID == null) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.DevInfo_nofind, new string[] { devName })); return; } this.tbDevName.Text = gateWaybyGID.GatewayName; this.labDevIp.Text = InSnergyService.getGatewayIP(gateWaybyGID.GatewayID); this.labDevType.Text = gateWaybyGID.GatewayType; this.dgvBranchPanels.Rows.Clear(); int num = 1; foreach (Branch current in gateWaybyGID.BranchList) { string[] values = new string[] { num.ToString(), current.BranchName, current.Location, current.SubMeterList.Count.ToString(), current.GatewayID, current.BranchID }; this.dgvBranchPanels.Rows.Add(values); num++; } }
private void DevtreeInit() { this.tvDev.Nodes.Clear(); System.GC.Collect(); TreeNode treeNode = new TreeNode(); treeNode.Text = EcoLanguage.getMsg(LangRes.DevRoot, new string[0]); treeNode.Name = "DevRoot"; treeNode.Tag = "DevRoot"; treeNode.ImageIndex = 0; treeNode.SelectedImageIndex = 0; this.tvDev.Nodes.Add(treeNode); System.Collections.Generic.List <DeviceInfo> allDevice = DeviceOperation.GetAllDevice(); for (int i = 0; i < allDevice.Count; i++) { DeviceInfo deviceInfo = allDevice[i]; string deviceName = deviceInfo.DeviceName; TreeNode treeNode2 = new TreeNode(); treeNode2.Text = deviceName; treeNode2.Name = deviceInfo.DeviceID.ToString(); treeNode2.Tag = deviceInfo.Mac; if (!ClientAPI.IsDeviceOnline(deviceInfo.DeviceID)) { treeNode2.ImageIndex = 2; treeNode2.SelectedImageIndex = 2; } else { treeNode2.ImageIndex = 3; treeNode2.SelectedImageIndex = 3; } treeNode.Nodes.Add(treeNode2); } }
private void btCfgBackup_Click(object sender, System.EventArgs e) { if (!DBMaintain.ConvertOldDataFinish) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.DB_inSplitMySQLTable, new string[0])); return; } bool flag = false; Ecovalidate.checkTextIsNull(this.tbBackupPath, ref flag); if (flag) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.lbBackupPath.Text })); return; } Program.IdleTimer_Pause(1); progressPopup progressPopup = new progressPopup("Information", 1, EcoLanguage.getMsg(LangRes.PopProgressMsg_saving, new string[0]), null, new progressPopup.ProcessInThread(this.backupcfgPro), this.tbBackupPath.Text, 0); progressPopup.ShowDialog(); object return_V = progressPopup.Return_V; Program.IdleTimer_Run(1); int?num = return_V as int?; if (!num.HasValue || num < 0) { EcoMessageBox.ShowError(this, EcoLanguage.getMsg(LangRes.OPfail, new string[0])); return; } EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0])); }
private void btnadd_Click(object sender, System.EventArgs e) { string text = ""; int count = this.grouplist.SelectedItems.Count; if (this.m_existgpnum + count > 4) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Group_selmaxnum, new string[0])); this.grouplist.Focus(); return; } foreach (ListViewItem listViewItem in this.grouplist.SelectedItems) { text = text + listViewItem.Tag + ","; } if (text.Length == 0) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Comm_selectneed, new string[0])); return; } text = text.Substring(0, text.Length - 1); GroupInfo.UpdateGroupThermalFlag(1, text); base.Close(); base.Dispose(); }
public DataGpOPAll() { this.InitializeComponent(); EcoGlobalVar.gl_DataGpOPAll = this; this.m_gptypeZoneNode = new TreeNode(); this.m_gptypeZoneNode.Text = EcoLanguage.getMsg(LangRes.Group_TPZone, new string[0]); this.m_gptypeZoneNode.Name = ""; this.m_gptypeZoneNode.Tag = "TPZone"; this.m_gptypeZoneNode.ImageIndex = 0; this.m_gptypeZoneNode.SelectedImageIndex = 0; this.m_gptypeRackNode = new TreeNode(); this.m_gptypeRackNode.Text = EcoLanguage.getMsg(LangRes.Group_TPRack, new string[0]); this.m_gptypeRackNode.Name = ""; this.m_gptypeRackNode.Tag = "TPRack"; this.m_gptypeRackNode.ImageIndex = 0; this.m_gptypeRackNode.SelectedImageIndex = 0; this.m_gptypeDevNode = new TreeNode(); this.m_gptypeDevNode.Text = EcoLanguage.getMsg(LangRes.Group_TPDev, new string[0]); this.m_gptypeDevNode.Name = ""; this.m_gptypeDevNode.Tag = "TPDev"; this.m_gptypeDevNode.ImageIndex = 0; this.m_gptypeDevNode.SelectedImageIndex = 0; this.m_gptypeOutletNode = new TreeNode(); this.m_gptypeOutletNode.Text = EcoLanguage.getMsg(LangRes.Group_TPOutlet, new string[0]); this.m_gptypeOutletNode.Name = ""; this.m_gptypeOutletNode.Tag = "TPOutlet"; this.m_gptypeOutletNode.ImageIndex = 0; this.m_gptypeOutletNode.SelectedImageIndex = 0; this.InitTimer(); ClientAPI.PendingChanged += new System.EventHandler <ClientAPI.PendingStatusArgs>(this.UI_OnPendingChanged); ClientAPI.RealtimeChanged += new System.EventHandler <ClientAPI.RealtimeDataArgs>(this.UI_OnRealtimeChanged); }
private void btnSave_Click(object sender, System.EventArgs e) { string text = this.txtpath.Text; if (text == "") { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.lbpath.Text })); return; } for (int i = 0; i < text.Length; i++) { char c = text.Substring(i, 1).ToCharArray()[0]; if (c > '~') { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.RptMng_pathErr1, new string[0])); return; } } int num = Sys_Para.UpdateDefinePath(this.txtpath.Text.Replace("'", "''")); if (num > 0) { EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0])); } }
public ThermGenRptParaGpAddDlg(int existgpnum) { this.InitializeComponent(); this.m_existgpnum = existgpnum; this.grouplist.Items.Clear(); System.Collections.Generic.List <GroupInfo> groupByThermalFlag = GroupInfo.GetGroupByThermalFlag(0); foreach (GroupInfo current in groupByThermalFlag) { ListViewItem listViewItem = new ListViewItem(); string text = ""; string groupType; if ((groupType = current.GroupType) != null) { if (!(groupType == "zone")) { if (groupType == "rack" || groupType == "allrack") { text = LangRes.Group_TPRack; } } else { text = LangRes.Group_TPZone; } } if (text.Length != 0) { listViewItem.Text = EcoLanguage.getMsg(text, new string[0]); listViewItem.SubItems.Add(current.GroupName); listViewItem.Tag = current.ID.ToString(); this.grouplist.Items.Add(listViewItem); } } }
private bool paraCheck() { bool flag = false; Ecovalidate.checkTextIsNull(this.textBoxMySQLPort, ref flag); if (flag) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.label1.Text })); return(false); } if (!Ecovalidate.Rangeint(this.textBoxMySQLPort, 1, 65535)) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Range, new string[] { this.label1.Text, "1", "65535" })); return(false); } Ecovalidate.checkTextIsNull(this.textBoxMySQLUsername, ref flag); if (flag) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.label2.Text })); return(false); } return(true); }
private bool DBparaCheck() { if (!this.checkBoxUseMySQL.Checked) { return(true); } bool flag = false; Ecovalidate.checkTextIsNull(this.tbDBIP, ref flag); if (flag) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.lbDBIP.Text })); return(false); } try { string text = IPAddress.Parse(this.tbDBIP.Text).ToString(); this.tbDBIP.Text = text; } catch (System.Exception) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.IPFORMAT, new string[0])); this.tbDBIP.Focus(); bool result = false; return(result); } Ecovalidate.checkTextIsNull(this.tbDBPort, ref flag); if (flag) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.lbDBPort.Text })); return(false); } if (!Ecovalidate.Rangeint(this.tbDBPort, 1, 65535)) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Range, new string[] { this.lbDBPort.Text, "1", "65535" })); return(false); } Ecovalidate.checkTextIsNull(this.tbDBUsrnm, ref flag); if (flag) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.lbDBUsrnm.Text })); return(false); } return(true); }
private void btnSearch_Click(object sender, System.EventArgs e) { string value; if (this.txtkey.TextLength != 0) { value = this.txtkey.Text.Trim(); } else { value = null; } int num; if (this.rbInclude.Checked) { num = 1; } else { if (this.rbExclude.Checked) { num = 2; } else { num = 0; this.dtpLogtimeFrom.Value = System.DateTime.Now; this.dtpLogtimeTo.Value = System.DateTime.Now; } } System.DateTime value2 = this.dtpLogtimeFrom.Value; System.DateTime value3 = this.dtpLogtimeTo.Value; LogSysLog.nTatalLogs = 0; LogSysLog.nCurrentPage = 1; LogSysLog.nTotalPage = 0; int rowCount = LogInfo.GetRowCount(num, value2, value3); System.Collections.ArrayList arrayList = new System.Collections.ArrayList(); arrayList.Add(value); arrayList.Add(num); arrayList.Add(value2); arrayList.Add(value3); DataTable dtab_logs; if (rowCount > 50000) { progressPopup progressPopup = new progressPopup("Information", 1, EcoLanguage.getMsg(LangRes.PopProgressMsg_searchLog, new string[0]), null, new progressPopup.ProcessInThread(this.searchLogProc), arrayList, 0); progressPopup.ShowDialog(); object obj = progressPopup.Return_V; dtab_logs = (obj as DataTable); } else { object obj = this.searchLogProc(arrayList); dtab_logs = (obj as DataTable); } this.displayFoundLogs(dtab_logs); }
private bool devConfigCheck() { string value = this.labDevModel.Tag.ToString(); string fmwareVer = this.labDevIp.Tag.ToString(); System.Convert.ToInt32(value); DevModelConfig deviceModelConfig = DevAccessCfg.GetInstance().getDeviceModelConfig(this.labDevModel.Text, fmwareVer); bool flag = false; if (this.tbRefVoltage.Visible) { Ecovalidate.checkTextIsNull(this.tbRefVoltage, ref flag); if (flag) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[] { this.lbRefVoltage.Text })); return(false); } if (!Ecovalidate.RangeDouble(this.tbRefVoltage, 90.0, 260.0)) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Range, new string[] { this.lbRefVoltage.Text, "90", "260" })); return(false); } } flag = true; int num = devcfgUtil.UIThresholdEditFlg(deviceModelConfig, "dev"); Ecovalidate.checkThresholdValue(this.tbMinCurrent, this.labMaxCurrentBound, (num & 256) == 0, ref flag); Ecovalidate.checkThresholdValue(this.tbMaxCurrent, this.labMaxCurrentBound, (num & 512) == 0, ref flag); Ecovalidate.checkThresholdValue(this.tbMinVoltage, this.labMaxVoltageBound, (num & 1024) == 0, ref flag); Ecovalidate.checkThresholdValue(this.tbMaxVoltage, this.labMaxVoltageBound, (num & 2048) == 0, ref flag); Ecovalidate.checkThresholdValue(this.tbMinPower, this.labMaxPowerBound, (num & 4096) == 0, ref flag); Ecovalidate.checkThresholdValue(this.tbMaxPower, this.labMaxPowerBound, (num & 8192) == 0, ref flag); Ecovalidate.checkThresholdValue(this.tbMinPowerDiss, this.labMaxPowerDisBound, (num & 16384) == 0, ref flag); Ecovalidate.checkThresholdValue(this.tbMaxPowerDiss, this.labMaxPowerDisBound, (num & 32768) == 0, ref flag); if (!flag) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Dev_Thresholdinvalid, new string[0])); return(false); } Ecovalidate.checkThresholdMaxMixValue(this.tbMaxCurrent, this.tbMinCurrent, ref flag); Ecovalidate.checkThresholdMaxMixValue(this.tbMaxVoltage, this.tbMinVoltage, ref flag); Ecovalidate.checkThresholdMaxMixValue(this.tbMaxPower, this.tbMinPower, ref flag); Ecovalidate.checkThresholdMaxMixValue(this.tbMaxPowerDiss, this.tbMinPowerDiss, ref flag); if (!flag) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Dev_ThresholdMinMax, new string[0])); return(false); } return(true); }
private void DataBind(string type) { string text = this.dtpFrom.Text; string text2 = this.dtpTo.Text; string str = this.txtkey.Text.Replace("'", "''"); string str_sql; if (type != null) { if (type == "0") { str_sql = string.Concat(new string[] { "select id,Title,Writer,ReportTime,ReportPath from reportinfo where ReportTime between #", text, "# and #", text2, "# order by ReportTime desc" }); goto IL_D1; } if (type == "1") { str_sql = "select id,Title,Writer,ReportTime,ReportPath from reportinfo where title like '%" + str + "%' order by ReportTime desc"; goto IL_D1; } if (type == "2") { str_sql = "select id,Title,Writer,ReportTime,ReportPath from reportinfo where writer like '%" + str + "%' order by ReportTime desc"; goto IL_D1; } } str_sql = "select id,Title,Writer,ReportTime,ReportPath from reportinfo order by ReportTime desc"; IL_D1: DataTable dataTable = DBTools.CreateDataTable4SysDB(str_sql); this.dgvwReport.Rows.Clear(); int num = 1; foreach (DataRow dataRow in dataTable.Rows) { System.DateTime dateTime = (System.DateTime)dataRow["ReportTime"]; object[] values = new object[] { num++, dataRow["id"].ToString(), dataRow["Title"].ToString(), dataRow["Writer"].ToString(), dateTime.ToString("yyyy-MM-dd HH:mm:ss"), dataRow["ReportPath"].ToString(), EcoLanguage.getMsg(LangRes.RptMng_OpenHTML, new string[0]), EcoLanguage.getMsg(LangRes.RptMng_OpenFolder, new string[0]) }; this.dgvwReport.Rows.Add(values); } this.dgvwReport.SelectionMode = DataGridViewSelectionMode.FullRowSelect; this.dgvwReport.ClearSelection(); }
private void butDel_Click(object sender, System.EventArgs e) { if (this.lbRack.SelectedItem == null) { return; } this.closetips(); int selectedIndex = this.lbRack.SelectedIndex; string text = this.lbRack.SelectedItem.ToString(); DialogResult dialogResult = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Rack_delCrm, new string[] { text }), MessageBoxButtons.OKCancel); if (dialogResult == DialogResult.Cancel) { return; } this.lbRack.Items.RemoveAt(selectedIndex); RackInfo rackInfo = (RackInfo)this.m_AllRacks[selectedIndex]; this.m_AllRacks.RemoveAt(selectedIndex); this.m_MapID2Rack.Remove(rackInfo.RackID); this.delRackUi(rackInfo.RackID); RackInfo.DeleteByID(rackInfo.RackID); string valuePair = ValuePairs.getValuePair("Username"); if (!string.IsNullOrEmpty(valuePair)) { LogAPI.writeEventLog("0430011", new string[] { text, valuePair }); } else { LogAPI.writeEventLog("0430011", new string[] { text }); } EcoGlobalVar.setDashBoardFlg(780uL, "", 64); if (this.lbRack.Items.Count == 0) { this.butDel.Enabled = false; this.butModify.Enabled = false; return; } if (selectedIndex < this.lbRack.Items.Count) { this.lbRack.SelectedIndex = selectedIndex; return; } this.lbRack.SelectedIndex = this.lbRack.Items.Count - 1; }
private void registrySettings_FormClosing(object sender, FormClosingEventArgs e) { if ((this.m_oldSrvStCode & DebugCenter.ST_fatalMask) == 0) { return; } if (base.DialogResult != DialogResult.OK && EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Login_quit, new string[0]), MessageBoxButtons.YesNo) == DialogResult.No) { e.Cancel = true; } }
public DataGroupDlg() { this.InitializeComponent(); this.tbname.ContextMenuStrip = EcoGlobalVar.nullcontextMenuStrip; this.cboType.Items.Clear(); this.cboType.Items.Add(EcoLanguage.getMsg(LangRes.Group_TPZone, new string[0])); this.cboType.Items.Add(EcoLanguage.getMsg(LangRes.Group_TPRack, new string[0])); this.cboType.Items.Add(EcoLanguage.getMsg(LangRes.Group_TPDev, new string[0])); this.cboType.Items.Add(EcoLanguage.getMsg(LangRes.Group_TPOutlet, new string[0])); this.cboType.SelectedIndex = 0; }
private void logout_LinkClicked(object sender, System.EventArgs e) { if (EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Login_quit, new string[0]), MessageBoxButtons.YesNo) == DialogResult.Yes) { this.Logout(); ClientAPI.Logout(); ClientAPI.StopBroadcastChannel(); EcoGlobalVar.stopalltimer(true); Program.ExitApp(); } }
public EPowerOp() { this.InitializeComponent(); this.m_AlldevicesNode = new TreeNode(); this.m_AlldevicesNode.Text = EcoLanguage.getMsg(LangRes.DevRoot, new string[0]); this.m_AlldevicesNode.Name = "DevRoot"; this.m_AlldevicesNode.Tag = "DevRoot"; this.m_AlldevicesNode.ImageIndex = 0; this.m_AlldevicesNode.SelectedImageIndex = 0; this.tvPowerControl.Nodes.Add(this.m_AlldevicesNode); }
private void FillData_Line(TreeNode denode, DataSet ds, string id, DevModelConfig devcfg) { if (devcfg.perlineReading == Constant.NO) { return; } DataTable dataTable = ds.Tables[4].Clone(); DataRow[] array = ds.Tables[4].Select("device_id= " + id); for (int i = 0; i < array.Length; i++) { dataTable.ImportRow(array[i]); } int uIthEdidflg = devcfgUtil.UIThresholdEditFlg(devcfg, "line"); for (int j = 0; j < dataTable.Rows.Count; j++) { bool flag = true; double maxV = ecoConvert.f2d(dataTable.Rows[j]["max_power"]); double minV = ecoConvert.f2d(dataTable.Rows[j]["min_power"]); double maxV2 = ecoConvert.f2d(dataTable.Rows[j]["max_current"]); double minV2 = ecoConvert.f2d(dataTable.Rows[j]["min_current"]); double maxV3 = ecoConvert.f2d(dataTable.Rows[j]["max_voltage"]); double minV3 = ecoConvert.f2d(dataTable.Rows[j]["min_voltage"]); TreeNode treeNode = new TreeNode(); treeNode.Name = "Line" + System.Convert.ToString(dataTable.Rows[j]["line_number"]); treeNode.ToolTipText = treeNode.Name; treeNode.Text = treeNode.Name; treeNode.ToolTipText = treeNode.Text; treeNode.ImageIndex = 34; treeNode.SelectedImageIndex = 34; TreeNode treeNode2 = this.genTreeNode(uIthEdidflg, 3, EcoLanguage.getMsg(LangRes.Title_Power, new string[0]), ecoConvert.f2d(dataTable.Rows[j]["power_value"]), minV, maxV, "F4", "W", 13, 15, 14, 12, ref flag); TreeNode treeNode3 = this.genTreeNode(uIthEdidflg, 2, EcoLanguage.getMsg(LangRes.Title_Voltage, new string[0]), ecoConvert.f2d(dataTable.Rows[j]["voltage_value"]), minV3, maxV3, "F2", "V", 25, 27, 26, 24, ref flag); TreeNode treeNode4 = this.genTreeNode(uIthEdidflg, 1, EcoLanguage.getMsg(LangRes.Title_Current, new string[0]), ecoConvert.f2d(dataTable.Rows[j]["current_value"]), minV2, maxV2, "F2", "A", 3, 5, 4, 2, ref flag); if (!flag) { if (treeNode2 != null) { treeNode.Nodes.Add(treeNode2); } if (treeNode3 != null) { treeNode.Nodes.Add(treeNode3); } if (treeNode4 != null) { treeNode.Nodes.Add(treeNode4); } denode.Nodes.Add(treeNode); denode.Expand(); treeNode.Expand(); } } }
private void btnPreview_Click(object sender, System.EventArgs e) { if (!this.m_isRPTSaved) { DialogResult dialogResult = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Rpt_notsaved, new string[0]), MessageBoxButtons.OKCancel); if (dialogResult == DialogResult.Cancel) { return; } } this.m_parent.showRpt(1, 0); }
private void btnSearch_Click(object sender, System.EventArgs e) { string text = this.cboby.SelectedIndex.ToString(); if (text != "0" && this.txtkey.Text == "") { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.RptMng_needKeyword, new string[0])); return; } this.DataBind(text); this.ShowAll = false; }
private void restoredb_FormClosing(object sender, FormClosingEventArgs e) { if (base.DialogResult != DialogResult.OK && this.m_exitPara == 1) { if (EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Login_quit, new string[0]), MessageBoxButtons.YesNo) == DialogResult.No) { e.Cancel = true; return; } Program.ExitApp(); } }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Login_quit, new string[0]), MessageBoxButtons.YesNo) == DialogResult.No) { e.Cancel = true; return; } this.Logout(); ClientAPI.StopBroadcastChannel(); EcoGlobalVar.stopalltimer(true); Program.ExitApp(); }
private void btnAdd_Click(object sender, System.EventArgs e) { if (this.grouplist.Items.Count >= 4) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Group_selmaxnum, new string[0])); return; } EGenRptParaGpAdd eGenRptParaGpAdd = new EGenRptParaGpAdd(this.grouplist.Items.Count); eGenRptParaGpAdd.ShowDialog(); this.FillgroupList(); }