Ejemplo n.º 1
0
        private void btnsaveopt_Click(object sender, System.EventArgs e)
        {
            if (!this.paraoptCheck())
            {
                return;
            }
            if (this.cbkeepdata.Checked)
            {
                Sys_Para.SetDBOpt_keepMMflag(1);
                int dBOpt_keepMM = System.Convert.ToInt32(this.tbkeepmonths.Text);
                Sys_Para.SetDBOpt_keepMM(dBOpt_keepMM);
            }
            else
            {
                Sys_Para.SetDBOpt_keepMMflag(0);
            }
            if (this.cbdelOlddata.Visible)
            {
                if (this.cbdelOlddata.Checked)
                {
                    Sys_Para.SetDBOpt_deloldflag(1);
                }
                else
                {
                    Sys_Para.SetDBOpt_deloldflag(0);
                }
            }
            string valuePair = ValuePairs.getValuePair("Username");

            if (!string.IsNullOrEmpty(valuePair))
            {
                LogAPI.writeEventLog("0130020", new string[]
                {
                    valuePair
                });
            }
            else
            {
                LogAPI.writeEventLog("0130020", new string[0]);
            }
            EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0]));
        }
Ejemplo n.º 2
0
        private void btnDel_Click(object sender, System.EventArgs e)
        {
            if (this.grouplist.SelectedItems.Count <= 0)
            {
                return;
            }
            if (EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Group_delCfm, new string[0]), MessageBoxButtons.OKCancel).Equals(DialogResult.Cancel))
            {
                return;
            }
            string value = this.grouplist.SelectedItems[0].Tag.ToString().Split(new char[]
            {
                '|'
            })[0];
            string text  = this.grouplist.SelectedItems[0].SubItems[0].Text;
            string text2 = this.grouplist.SelectedItems[0].SubItems[1].Text;
            int    num   = GroupInfo.DeleteGroupByID((long)System.Convert.ToInt32(value));

            if (num > 0)
            {
                LogAPI.writeEventLog("0430031", new string[]
                {
                    text2,
                    text,
                    EcoGlobalVar.gl_LoginUser.UserName
                });
                EcoGlobalVar.setDashBoardFlg(520uL, "", 64);
                this.FillList();
                if (this.grouplist.Items.Count == 0)
                {
                    this.btnDel.Enabled    = false;
                    this.btnModify.Enabled = false;
                    this.itemlist.Columns.Clear();
                    this.itemlist.Items.Clear();
                    return;
                }
            }
            else
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0]));
            }
        }
Ejemplo n.º 3
0
        private void butDel_Click(object sender, System.EventArgs e)
        {
            TreeNode selectedNode = this.tvZone.SelectedNode;

            if (selectedNode == null)
            {
                return;
            }
            string       text         = selectedNode.Text;
            DialogResult dialogResult = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Zone_delCrm, new string[]
            {
                text
            }), MessageBoxButtons.OKCancel);

            if (dialogResult == DialogResult.Cancel)
            {
                return;
            }
            ZoneInfo.DeleteByName(text);
            string valuePair = ValuePairs.getValuePair("Username");

            if (!string.IsNullOrEmpty(valuePair))
            {
                LogAPI.writeEventLog("0430021", new string[]
                {
                    text,
                    valuePair
                });
            }
            else
            {
                LogAPI.writeEventLog("0430021", new string[]
                {
                    text
                });
            }
            EcoGlobalVar.setDashBoardFlg(776uL, "", 64);
            this.treeMenuInit();
            this.zonerackInit();
            this.butAdd.Enabled = false;
            EcoGlobalVar.gl_DevManPage.FlushFlg_ZoneBoard = 1;
        }
Ejemplo n.º 4
0
 private void btndel_Click(object sender, System.EventArgs e)
 {
     if (this.dgvwReport.SelectedRows.Count > 0)
     {
         if (EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.RptMng_delCrm, new string[0]), MessageBoxButtons.OKCancel).Equals(DialogResult.OK))
         {
             string text = this.dgvwReport.SelectedRows[0].Cells["ReportPath"].Value.ToString();
             string path = text.Substring(0, text.LastIndexOf('\\'));
             if (System.IO.Directory.Exists(path))
             {
                 try
                 {
                     System.IO.Directory.Delete(path, true);
                 }
                 catch
                 {
                     System.Console.WriteLine("Delete report fail,it is being used by another process");
                     EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0]));
                     return;
                 }
             }
             string sql = "delete from reportinfo where id=" + this.dgvwReport.SelectedRows[0].Cells[1].Value;
             int    num = DBTools.executeSql(sql);
             if (num > 0)
             {
                 EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0]));
             }
             if (this.ShowAll)
             {
                 this.DataBind("");
                 return;
             }
             this.DataBind(this.cboby.SelectedIndex.ToString());
             return;
         }
     }
     else
     {
         EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Comm_selectneed, new string[0]));
     }
 }
Ejemplo n.º 5
0
 public void pageInit(UserControl pParent, TreeNode rootNode)
 {
     this.m_pParent = pParent;
     this.dgvUserAll.Rows.Clear();
     foreach (TreeNode treeNode in rootNode.Nodes)
     {
         string   text  = treeNode.Text;
         string[] array = treeNode.Name.Split(new char[]
         {
             '|'
         });
         System.Convert.ToInt16(array[1]);
         short  num = System.Convert.ToInt16(array[0]);
         string msg;
         if (num == 0)
         {
             msg = EcoLanguage.getMsg(LangRes.UsrInfo_TPadmin, new string[0]);
         }
         else
         {
             msg = EcoLanguage.getMsg(LangRes.UsrInfo_TPuser, new string[0]);
         }
         short  num2 = System.Convert.ToInt16(array[1]);
         string msg2;
         if (num2 == 1)
         {
             msg2 = EcoLanguage.getMsg(LangRes.UsrInfo_STactive, new string[0]);
         }
         else
         {
             msg2 = EcoLanguage.getMsg(LangRes.UsrInfo_STinactive, new string[0]);
         }
         string[] values = new string[]
         {
             text,
             msg,
             msg2
         };
         this.dgvUserAll.Rows.Add(values);
     }
 }
Ejemplo n.º 6
0
        private void dgvAllDevices_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int rowIndex = e.RowIndex;

            if (rowIndex < 0)
            {
                return;
            }
            string value = this.dgvAllDevices.Rows[rowIndex].Cells["deviceId"].Value.ToString();

            if (!ClientAPI.IsDeviceOnline(System.Convert.ToInt32(value)))
            {
                DialogResult dialogResult = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Comm_devofflineCrm, new string[0]), MessageBoxButtons.OKCancel);
                if (dialogResult == DialogResult.Cancel)
                {
                    return;
                }
            }
            this.m_devID      = System.Convert.ToInt32(value);
            base.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 7
0
        private void btnendsession_Click(object sender, System.EventArgs e)
        {
            if (this.dgvSessions.Rows.Count == 0)
            {
                return;
            }
            string text = "";

            for (int i = 0; i < this.dgvSessions.Rows.Count; i++)
            {
                DataGridViewRow dataGridViewRow = this.dgvSessions.Rows[i];
                if (System.Convert.ToBoolean(dataGridViewRow.Cells[1].Value))
                {
                    string str = System.Convert.ToString(dataGridViewRow.Cells[5].Value);
                    text = text + str + ",";
                }
            }
            ClientAPI.RemoteCall(103, 1, text, 10000);
            EcoMessageBox.ShowInfo(this, EcoLanguage.getMsg(LangRes.OPsucc, new string[0]));
            this.pageInit();
        }
Ejemplo n.º 8
0
        private void btnsave_Click(object sender, System.EventArgs e)
        {
            if (!this.paraCheck())
            {
                return;
            }
            int    num   = System.Convert.ToInt32(this.textBoxMySQLPort.Text);
            string text  = this.textBoxMySQLUsername.Text;
            string text2 = this.textBoxMySQLPassword.Text;
            int    num2  = DBUtil.CheckMySQLParameter_NOName("127.0.0.1", num, text, text2);

            if (num2 != DebugCenter.ST_Success)
            {
                EcoMessageBox.ShowError(this, EcoLanguage.getMsg(LangRes.DB_Connectfail, new string[0]));
                return;
            }
            this.m_DBport     = num;
            this.m_usrnm      = text;
            this.m_psw        = text2;
            base.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 9
0
        public void pageInit(Billing parent)
        {
            this.m_parent          = parent;
            this.pbLoading.Visible = false;
            this.btndel.Enabled    = true;
            this.btnAdd.Enabled    = true;
            this.dtptime.Value     = System.DateTime.Now;
            System.DateTime value = this.dtpbegin.Value;
            int             month = value.Month;

            System.DateTime value2 = new System.DateTime(value.Year, month, 1, value.Hour, value.Minute, value.Second, value.Millisecond);
            this.dtpbegin.Value          = value2;
            this.cbRptType.SelectedIndex = 0;
            this.FillgroupList();
            if (!DBTools.DatabaseIsReady())
            {
                EcoMessageBox.ShowInfo(this, EcoLanguage.getMsg(LangRes.DB_waitready, new string[0]));
                this.btnGen.Enabled = false;
                return;
            }
            this.btnGen.Enabled = true;
        }
Ejemplo n.º 10
0
        public void pageInit()
        {
            this.dataGridViewCfgTasks.Rows.Clear();
            System.Collections.Generic.List <Backuptask> allTask = Backuptask.GetAllTask();
            int num = 0;

            foreach (Backuptask current in allTask)
            {
                string msg = EcoLanguage.getMsg(LangRes.Task_TPDaily, new string[0]);
                switch (current.TaskType)
                {
                case 0:
                    msg = EcoLanguage.getMsg(LangRes.Task_TPDaily, new string[0]);
                    break;

                case 1:
                    msg = EcoLanguage.getMsg(LangRes.Task_TPWeekly, new string[0]);
                    break;
                }
                object[] values = new object[]
                {
                    num + 1,
                    current.TaskName,
                    msg,
                    current.Filepath,
                    current.ID.ToString()
                };
                this.dataGridViewCfgTasks.Rows.Add(values);
                num++;
            }
            if (this.dataGridViewCfgTasks.Rows.Count == 0)
            {
                this.butModify.Enabled = false;
                this.butDelete.Enabled = false;
                return;
            }
            this.butModify.Enabled = true;
            this.butDelete.Enabled = true;
        }
Ejemplo n.º 11
0
 public void TimerProc(int haveThresholdChange)
 {
     if (this.m_ininit)
     {
         return;
     }
     foreach (DataGridViewRow dataGridViewRow in (System.Collections.IEnumerable) this.dgvAllDevices.Rows)
     {
         DataGridViewCellCollection cells = dataGridViewRow.Cells;
         string value = cells["dgvtbcdeviceId"].Value.ToString();
         if (ClientAPI.IsDeviceOnline(System.Convert.ToInt32(value)))
         {
             cells["imgstatus"].Value       = this.imgon;
             cells["imgstatus"].ToolTipText = null;
         }
         else
         {
             if (ClientAPI.IsMACConflict(System.Convert.ToString(cells["dgvtbcMac"].Value)))
             {
                 cells["imgstatus"].Value       = this.imgConflict;
                 cells["imgstatus"].ToolTipText = EcoLanguage.getMsg(LangRes.tips_MACMismatch, new string[0]);
             }
             else
             {
                 cells["imgstatus"].Value       = this.imgoff;
                 cells["imgstatus"].ToolTipText = null;
             }
         }
         if (haveThresholdChange == 1)
         {
             DeviceInfo deviceByID = DeviceOperation.getDeviceByID(System.Convert.ToInt32(value));
             string     text       = cells["dgvtbDeviceNm"].Value.ToString();
             if (!text.Equals(deviceByID.DeviceName))
             {
                 cells["dgvtbDeviceNm"].Value = deviceByID.DeviceName;
             }
         }
     }
 }
Ejemplo n.º 12
0
 private void btnExport_Click(object sender, System.EventArgs e)
 {
     System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(this.SaveFile));
     thread.SetApartmentState(System.Threading.ApartmentState.STA);
     if (thread.ThreadState != System.Threading.ThreadState.Running)
     {
         thread.Start();
         thread.Join();
     }
     if (this.SaveSuccess == 1)
     {
         EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0]));
     }
     else
     {
         if (this.SaveSuccess == 2)
         {
             EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0]));
         }
     }
     this.SaveSuccess = 0;
 }
Ejemplo n.º 13
0
        private void butUserDel_Click(object sender, System.EventArgs e)
        {
            string       text         = this.dgvUserAll.CurrentRow.Cells[0].Value.ToString();
            DialogResult dialogResult = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.UsrInfo_delCrm, new string[0]), MessageBoxButtons.OKCancel);

            if (dialogResult == DialogResult.Cancel)
            {
                return;
            }
            int num = UserMaintain.DeleteByName(text);

            if (num < 0)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.UsrInfo_delfail, new string[]
                {
                    text
                }));
                return;
            }
            EcoGlobalVar.setDashBoardFlg(8192uL, "USER:"******"Username");

            if (!string.IsNullOrEmpty(valuePair))
            {
                LogAPI.writeEventLog("0330001", new string[]
                {
                    text,
                    valuePair
                });
            }
            else
            {
                LogAPI.writeEventLog("0330001", new string[]
                {
                    text
                });
            }
            this.changeTreeSelect("");
        }
Ejemplo n.º 14
0
        public EGenRptParaGpAdd(int existgpnum)
        {
            this.InitializeComponent();
            this.m_existgpnum = existgpnum;
            this.grouplist.Items.Clear();
            System.Collections.Generic.List <GroupInfo> partGroup = GroupInfo.GetPartGroup(0);
            foreach (GroupInfo current in partGroup)
            {
                ListViewItem listViewItem = new ListViewItem();
                string       skey         = "";
                string       groupType;
                switch (groupType = current.GroupType)
                {
                case "zone":
                    skey = LangRes.Group_TPZone;
                    break;

                case "rack":
                case "allrack":
                    skey = LangRes.Group_TPRack;
                    break;

                case "dev":
                case "alldev":
                    skey = LangRes.Group_TPDev;
                    break;

                case "outlet":
                case "alloutlet":
                    skey = LangRes.Group_TPOutlet;
                    break;
                }
                listViewItem.Text = EcoLanguage.getMsg(skey, new string[0]);
                listViewItem.SubItems.Add(current.GroupName);
                listViewItem.Tag = current.ID.ToString();
                this.grouplist.Items.Add(listViewItem);
            }
        }
Ejemplo n.º 15
0
        private void UsertreeInit()
        {
            this.tvUser.Nodes.Clear();
            TreeNode treeNode = new TreeNode();

            treeNode.Text = EcoLanguage.getMsg(LangRes.UserRoot, new string[0]);
            treeNode.Name = "UserRoot";
            treeNode.Tag  = "UserRoot";
            this.tvUser.Nodes.Add(treeNode);
            System.Collections.Generic.List <UserInfo> allUsers = UserMaintain.getAllUsers();
            for (int i = 0; i < allUsers.Count; i++)
            {
                UserInfo userInfo  = allUsers[i];
                string   userName  = userInfo.UserName;
                TreeNode treeNode2 = new TreeNode();
                treeNode2.Text = userName;
                int userType   = userInfo.UserType;
                int userStatus = userInfo.UserStatus;
                treeNode2.Name = userType + "|" + userStatus;
                treeNode2.Tag  = "User";
                treeNode.Nodes.Add(treeNode2);
            }
        }
Ejemplo n.º 16
0
        private void butSel_Click(object sender, System.EventArgs e)
        {
            DataGridViewSelectedRowCollection selectedRows = this.dgvAllDevices.SelectedRows;

            if (selectedRows.Count <= 0)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Comm_selectneed, new string[0]));
                return;
            }
            DataGridViewRow dataGridViewRow = selectedRows[0];
            string          value           = dataGridViewRow.Cells["deviceId"].Value.ToString();

            this.m_devID = System.Convert.ToInt32(value);
            if (!ClientAPI.IsDeviceOnline(this.m_devID))
            {
                DialogResult dialogResult = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Comm_devofflineCrm, new string[0]), MessageBoxButtons.OKCancel);
                if (dialogResult == DialogResult.Cancel)
                {
                    return;
                }
            }
            base.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 17
0
        private void CreateChart()
        {
            string msg = EcoLanguage.getMsg(LangRes.Rpt_BillTitle, new string[]
            {
                this.m_pParaClass.Txtwriter,
                this.m_pParaClass.Dtptime
            });

            this.lbRPT_title.Text = msg;
            DataTable dataTableRst = this.m_pParaClass.DataTableRst;

            this.dgvBilling.DataSource = null;
            this.dgvBilling.DataSource = dataTableRst;
            int tableType_index = this.m_pParaClass.tableType_index;

            for (int i = 0; i < this.dgvBilling.Columns.Count; i++)
            {
                this.dgvBilling.Columns[i].Width    = BillingRptShow.TableWidth[tableType_index][i];
                this.dgvBilling.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                if (i != 0 && (this.m_pParaClass.RptType != 2 || i != 1))
                {
                    this.dgvBilling.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                }
            }
            for (int j = 0; j < this.dgvBilling.Rows.Count; j++)
            {
                for (int k = 0; k < this.dgvBilling.Columns.Count; k++)
                {
                    string text = this.dgvBilling.Rows[j].Cells[k].Value.ToString();
                    if (text.Equals(EcoLanguage.getMsg(LangRes.BILLTB_Subtotal, new string[0])))
                    {
                        this.dgvBilling.Rows[j].Cells[k].Style.Alignment = DataGridViewContentAlignment.MiddleRight;
                    }
                }
            }
            this.dgvBilling.Columns[this.dgvBilling.ColumnCount - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
        }
Ejemplo n.º 18
0
        private void butAddDevices_Click(object sender, System.EventArgs e)
        {
            if (this.dgvAllDevices.Rows.Count >= EcoGlobalVar.gl_maxDevNum)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Dev_MaxNum, new string[]
                {
                    EcoGlobalVar.gl_maxDevNum.ToString()
                }));
                return;
            }
            ScanDevDlg scanDevDlg = new ScanDevDlg();

            scanDevDlg.pageInit();
            scanDevDlg.ShowDialog(this);
            string iPs = scanDevDlg.getIPs();

            if (iPs.Length == 0)
            {
                return;
            }
            AddDevDlg addDevDlg = new AddDevDlg();

            addDevDlg.pageInit(scanDevDlg.getScanCompany(), iPs, scanDevDlg.getSNMPpara());
            DialogResult dialogResult = DialogResult.Cancel;

            try
            {
                dialogResult = addDevDlg.ShowDialog(this);
            }
            catch (System.Exception)
            {
            }
            if (dialogResult == DialogResult.OK)
            {
                this.changeTreeSelect("DevRoot");
            }
        }
Ejemplo n.º 19
0
        private void butDelete_Click(object sender, System.EventArgs e)
        {
            string       value        = this.dataGridViewCfgTasks.CurrentRow.Cells[4].Value.ToString();
            long         i_taskid     = (long)System.Convert.ToInt32(value);
            DialogResult dialogResult = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.Task_delCrm, new string[0]), MessageBoxButtons.OKCancel);

            if (dialogResult == DialogResult.Cancel)
            {
                return;
            }
            Backuptask taskByID = Backuptask.GetTaskByID(i_taskid);
            int        num      = Backuptask.DeleteTaskByID(i_taskid);

            if (num < 0)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0]));
                return;
            }
            string valuePair = ValuePairs.getValuePair("Username");

            if (!string.IsNullOrEmpty(valuePair))
            {
                LogAPI.writeEventLog("0530001", new string[]
                {
                    taskByID.TaskName,
                    valuePair
                });
            }
            else
            {
                LogAPI.writeEventLog("0530001", new string[]
                {
                    taskByID.TaskName
                });
            }
            this.pageInit();
        }
Ejemplo n.º 20
0
        private bool devConfigCheck()
        {
            string text = this.tbDevName.Text.Trim();

            this.tbDevName.Text = text;
            bool flag = false;

            Ecovalidate.checkTextIsNull(this.tbDevName, ref flag);
            if (flag)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                {
                    this.lbName.Text
                }));
                this.tbDevName.BackColor = Color.Red;
                return(false);
            }
            InSnergyGateway gateWaybyGID = InSnergyGateway.GetGateWaybyGID(this.m_gatewayID);

            if (text.Equals(gateWaybyGID.GatewayName))
            {
                this.tbDevName.BackColor = Color.White;
                return(true);
            }
            if (!InSnergyGateway.CheckGatewayName(text))
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Dev_nmdup, new string[]
                {
                    this.tbDevName.Text
                }));
                this.tbDevName.Focus();
                this.tbDevName.BackColor = Color.Red;
                return(false);
            }
            this.tbDevName.BackColor = Color.White;
            return(true);
        }
Ejemplo n.º 21
0
        private void btnGen_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.txttitle, ref flag);
            if (flag)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                {
                    this.lbtitle.Text
                }));
                this.txttitle.Focus();
                return;
            }
            Ecovalidate.checkTextIsNull(this.txtwrite, ref flag);
            if (flag)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                {
                    this.lbwriter.Text
                }));
                this.txtwrite.Focus();
                return;
            }
            if (this.grouplist.Items.Count == 0)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Group_needadd, new string[0]));
                return;
            }
            DebugCenter.GetInstance().appendToFile("BillingAnalysis Start.");
            this.m_parent.showRpt(2, 0);
        }
Ejemplo n.º 22
0
        private void butUserAdd_Click(object sender, System.EventArgs e)
        {
            System.Collections.Generic.List <UserInfo> allUsers = UserMaintain.getAllUsers();
            int num = 8;

            if (allUsers.Count >= num)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.UsrInfo_limit, new string[]
                {
                    num.ToString()
                }));
                return;
            }
            UserManAddUser userManAddUser = new UserManAddUser();
            DialogResult   dialogResult   = userManAddUser.ShowDialog();

            if (dialogResult == DialogResult.Cancel)
            {
                return;
            }
            string userNM = userManAddUser.UserNM;

            this.changeTreeSelect(userNM);
        }
Ejemplo n.º 23
0
        private void dgvwReport_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                switch (e.ColumnIndex)
                {
                case 6:
                {
                    string text = this.dgvwReport.Rows[e.RowIndex].Cells["ReportPath"].Value.ToString();
                    if (System.IO.File.Exists(text))
                    {
                        Process.Start("explorer.exe", text);
                        return;
                    }
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.RptMng_notExist, new string[0]));
                    return;
                }

                case 7:
                {
                    string text          = this.dgvwReport.Rows[e.RowIndex].Cells["ReportPath"].Value.ToString();
                    string directoryName = System.IO.Path.GetDirectoryName(text);
                    if (System.IO.Directory.Exists(directoryName))
                    {
                        Process.Start(directoryName);
                        return;
                    }
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.RptMng_notExist, new string[0]));
                    break;
                }

                default:
                    return;
                }
            }
        }
Ejemplo n.º 24
0
        private bool lineCheck(DevModelConfig devcfg)
        {
            string text = this.labLineNo.Text;

            System.Convert.ToInt32(text);
            bool flag = false;

            if (this.gbThreshold.Visible)
            {
                flag = true;
                int num = devcfgUtil.UIThresholdEditFlg(devcfg, "line");
                Ecovalidate.checkThresholdValue(this.tbLMinCurrent, this.labMaxCurrentBound, (num & 256) == 0, ref flag);
                Ecovalidate.checkThresholdValue(this.tbLMaxCurrent, this.labMaxCurrentBound, (num & 512) == 0, ref flag);
                Ecovalidate.checkThresholdValue(this.tbLMinVoltage, this.labMaxVoltageBound, (num & 1024) == 0, ref flag);
                Ecovalidate.checkThresholdValue(this.tbLMaxVoltage, this.labMaxVoltageBound, (num & 2048) == 0, ref flag);
                Ecovalidate.checkThresholdValue(this.tbLMinPower, this.labMaxPowerBound, (num & 4096) == 0, ref flag);
                Ecovalidate.checkThresholdValue(this.tbLMaxPower, this.labMaxPowerBound, (num & 8192) == 0, ref flag);
                Ecovalidate.checkThresholdValue(this.tbLMinPowerDiss, this.labMaxPowerDisBound, (num & 16384) == 0, ref flag);
                Ecovalidate.checkThresholdValue(this.tbLMaxPowerDiss, this.labMaxPowerDisBound, (num & 32768) == 0, ref flag);
                if (!flag)
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Dev_Thresholdinvalid, new string[0]));
                    return(false);
                }
                Ecovalidate.checkThresholdMaxMixValue(this.tbLMaxCurrent, this.tbLMinCurrent, ref flag);
                Ecovalidate.checkThresholdMaxMixValue(this.tbLMaxVoltage, this.tbLMinVoltage, ref flag);
                Ecovalidate.checkThresholdMaxMixValue(this.tbLMaxPower, this.tbLMinPower, ref flag);
                Ecovalidate.checkThresholdMaxMixValue(this.tbLMaxPowerDiss, this.tbLMinPowerDiss, ref flag);
                if (!flag)
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Dev_ThresholdMinMax, new string[0]));
                    return(false);
                }
            }
            return(true);
        }
Ejemplo n.º 25
0
        public int addZone(string zoneNm, Color color)
        {
            string text = "";
            int    num  = System.Math.Min(this.zonedef_startR, this.zonedef_endR);
            int    num2 = System.Math.Max(this.zonedef_startR, this.zonedef_endR);
            int    num3 = System.Math.Min(this.zonedef_startC, this.zonedef_endC);
            int    num4 = System.Math.Max(this.zonedef_startC, this.zonedef_endC);

            for (int i = num; i <= num2; i++)
            {
                for (int j = num3; j <= num4; j++)
                {
                    DataGridViewSpanCell dataGridViewSpanCell = (DataGridViewSpanCell)this.dgvSetDevice.Rows[i].Cells[j];
                    if (dataGridViewSpanCell.GetRowSpan() != 0 || dataGridViewSpanCell.GetColumnSpan() != 0)
                    {
                        string str = dataGridViewSpanCell.Tag.ToString();
                        text = text + str + ",";
                    }
                }
            }
            text = commUtil.uniqueIDs(text);
            if (text.Length > 0)
            {
                text = text.Substring(0, text.Length - 1);
            }
            this.zonedef_cancel();
            int result = ZoneInfo.CreateZoneInfo(zoneNm, text, num, num3, num2, num4, color.ToArgb().ToString());

            switch (result)
            {
            case -2:
            case -1:
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0]));
                break;

            case 1:
            {
                string valuePair = ValuePairs.getValuePair("Username");
                if (!string.IsNullOrEmpty(valuePair))
                {
                    LogAPI.writeEventLog("0430020", new string[]
                        {
                            zoneNm,
                            valuePair
                        });
                }
                else
                {
                    LogAPI.writeEventLog("0430020", new string[]
                        {
                            zoneNm
                        });
                }
                EcoGlobalVar.setDashBoardFlg(256uL, "", 0);
                EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0]));
                this.treeMenuInit();
                this.treeMenuSelect(zoneNm);
                this.butAdd.Enabled = false;
                EcoGlobalVar.gl_DevManPage.FlushFlg_ZoneBoard = 1;
                break;
            }
            }
            return(result);
        }
Ejemplo n.º 26
0
        private void show_devTb()
        {
            this.m_ininit = true;
            DataGridViewColumn sortedColumn = this.dgvAllDevices.SortedColumn;

            this.dgvAllDevices.Rows.Clear();
            System.Collections.Generic.Dictionary <long, CommParaClass> deviceRackMapping = DeviceOperation.GetDeviceRackMapping();
            System.Collections.Generic.List <DeviceInfo> allDevice = DeviceOperation.GetAllDevice();
            foreach (TreeNode treeNode in this.m_rootNode.Nodes)
            {
                string     text       = treeNode.Text;
                long       num        = System.Convert.ToInt64(treeNode.Name);
                bool       flag       = false;
                DeviceInfo deviceInfo = null;
                for (int i = 0; i < allDevice.Count; i++)
                {
                    deviceInfo = allDevice[i];
                    if ((long)deviceInfo.DeviceID == num)
                    {
                        flag = true;
                        break;
                    }
                }
                if (flag)
                {
                    string    text2     = "";
                    IPAddress iPAddress = IPAddress.Parse(deviceInfo.DeviceIP);
                    if (deviceRackMapping.ContainsKey(num))
                    {
                        text2 = deviceRackMapping[num].String_First;
                    }
                    string text3 = this.tbFilterKey.Text;
                    if (text3.Length <= 0 || text.Contains(text3) || deviceInfo.Mac.Contains(text3) || iPAddress.ToString().Contains(text3) || deviceInfo.Port.ToString().Contains(text3) || deviceInfo.ModelNm.Contains(text3) || text2.Contains(text3))
                    {
                        object[] values;
                        if (ClientAPI.IsDeviceOnline(deviceInfo.DeviceID))
                        {
                            values = new object[]
                            {
                                this.imgon,
                                text,
                                deviceInfo.Mac,
                                iPAddress,
                                deviceInfo.Port,
                                deviceInfo.ModelNm,
                                text2,
                                num.ToString()
                            };
                        }
                        else
                        {
                            if (ClientAPI.IsMACConflict(deviceInfo.Mac))
                            {
                                values = new object[]
                                {
                                    this.imgConflict,
                                    text,
                                    deviceInfo.Mac,
                                    iPAddress,
                                    deviceInfo.Port,
                                    deviceInfo.ModelNm,
                                    text2,
                                    num.ToString()
                                };
                            }
                            else
                            {
                                values = new object[]
                                {
                                    this.imgoff,
                                    text,
                                    deviceInfo.Mac,
                                    iPAddress,
                                    deviceInfo.Port,
                                    deviceInfo.ModelNm,
                                    text2,
                                    num.ToString()
                                };
                            }
                        }
                        this.dgvAllDevices.Rows.Add(values);
                    }
                }
            }
            foreach (DataGridViewRow dataGridViewRow in (System.Collections.IEnumerable) this.dgvAllDevices.Rows)
            {
                DataGridViewCell dataGridViewCell = dataGridViewRow.Cells[0];
                if (dataGridViewCell.Value.Equals(this.imgConflict))
                {
                    dataGridViewCell.ToolTipText = EcoLanguage.getMsg(LangRes.tips_MACMismatch, new string[0]);
                }
            }
            if (sortedColumn != null)
            {
                ListSortDirection direction = (this.dgvAllDevices.SortOrder == SortOrder.Ascending) ? ListSortDirection.Ascending : ListSortDirection.Descending;
                this.dgvAllDevices.Sort(sortedColumn, direction);
            }
            if (this.dgvAllDevices.Rows.Count == 0)
            {
                this.butDevicesDel.Enabled    = false;
                this.butDeviceSetup.Enabled   = false;
                this.butSyncThreshold.Enabled = false;
            }
            else
            {
                this.butDevicesDel.Enabled    = true;
                this.butDeviceSetup.Enabled   = true;
                this.butSyncThreshold.Enabled = true;
            }
            this.m_ininit = false;
        }
Ejemplo n.º 27
0
        private void buttonOK_Click(object sender, System.EventArgs e)
        {
            bool flag = false;

            if (this.textBoxTP1.Visible)
            {
                Ecovalidate.checkTextIsNull(this.textBoxTP1, ref flag);
                if (flag)
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                    {
                        this.labelGN1.Text
                    }));
                    this.textBoxTP1.Focus();
                    return;
                }
                if (!Ecovalidate.NumberFormat_double(this.textBoxTP1))
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Comm_invalidNumber, new string[0]));
                    return;
                }
            }
            if (this.textBoxTP2.Visible)
            {
                Ecovalidate.checkTextIsNull(this.textBoxTP2, ref flag);
                if (flag)
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                    {
                        this.labelGN2.Text
                    }));
                    this.textBoxTP2.Focus();
                    return;
                }
                if (!Ecovalidate.NumberFormat_double(this.textBoxTP2))
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Comm_invalidNumber, new string[0]));
                    return;
                }
            }
            if (this.textBoxTP3.Visible)
            {
                Ecovalidate.checkTextIsNull(this.textBoxTP3, ref flag);
                if (flag)
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                    {
                        this.labelGN3.Text
                    }));
                    this.textBoxTP3.Focus();
                    return;
                }
                if (!Ecovalidate.NumberFormat_double(this.textBoxTP3))
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Comm_invalidNumber, new string[0]));
                    return;
                }
            }
            if (this.textBoxTP4.Visible)
            {
                Ecovalidate.checkTextIsNull(this.textBoxTP4, ref flag);
                if (flag)
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                    {
                        this.labelGN4.Text
                    }));
                    this.textBoxTP4.Focus();
                    return;
                }
                if (!Ecovalidate.NumberFormat_double(this.textBoxTP4))
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Comm_invalidNumber, new string[0]));
                    return;
                }
            }
            for (int i = 0; i < this.m_Grouplist.Count; i++)
            {
                ListViewItem listViewItem = this.m_Grouplist[i];
                switch (i)
                {
                case 0:
                {
                    string   text  = listViewItem.Tag.ToString();
                    string[] array = text.Split(new char[]
                        {
                            '|'
                        });
                    string tag = string.Concat(new string[]
                        {
                            array[0],
                            "|",
                            array[1],
                            "|",
                            array[2],
                            "|",
                            this.textBoxTP1.Text
                        });
                    listViewItem.Tag = tag;
                    break;
                }

                case 1:
                {
                    string   text  = listViewItem.Tag.ToString();
                    string[] array = text.Split(new char[]
                        {
                            '|'
                        });
                    string tag = string.Concat(new string[]
                        {
                            array[0],
                            "|",
                            array[1],
                            "|",
                            array[2],
                            "|",
                            this.textBoxTP2.Text
                        });
                    listViewItem.Tag = tag;
                    break;
                }

                case 2:
                {
                    string   text  = listViewItem.Tag.ToString();
                    string[] array = text.Split(new char[]
                        {
                            '|'
                        });
                    string tag = string.Concat(new string[]
                        {
                            array[0],
                            "|",
                            array[1],
                            "|",
                            array[2],
                            "|",
                            this.textBoxTP3.Text
                        });
                    listViewItem.Tag = tag;
                    break;
                }

                case 3:
                {
                    string   text  = listViewItem.Tag.ToString();
                    string[] array = text.Split(new char[]
                        {
                            '|'
                        });
                    string tag = string.Concat(new string[]
                        {
                            array[0],
                            "|",
                            array[1],
                            "|",
                            array[2],
                            "|",
                            this.textBoxTP4.Text
                        });
                    listViewItem.Tag = tag;
                    break;
                }
                }
            }
            base.DialogResult = DialogResult.OK;
            base.Close();
            base.Dispose();
        }
Ejemplo n.º 28
0
        private void btnGen_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.txttitle, ref flag);
            if (flag)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                {
                    this.lbtitle.Text
                }));
                this.txttitle.Focus();
                return;
            }
            Ecovalidate.checkTextIsNull(this.txtwrite, ref flag);
            if (flag)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                {
                    this.lbwriter.Text
                }));
                this.txtwrite.Focus();
                return;
            }
            if (this.grouplist.Items.Count == 0)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Group_needadd, new string[0]));
                return;
            }
            if (this.cboperiod.SelectedIndex == 1)
            {
                Ecovalidate.checkTextIsNull(this.tbduration, ref flag);
                if (flag)
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                    {
                        this.label15.Text
                    }));
                    this.txtwrite.Focus();
                    return;
                }
                if (!Ecovalidate.Rangeint(this.tbduration, 1, 31))
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Range, new string[]
                    {
                        this.label15.Text,
                        "1",
                        "31"
                    }));
                    return;
                }
            }
            if (!this.chkchart1.Checked && !this.chkchart2.Checked && !this.chkchart3.Checked && !this.chkchart4.Checked && !this.chkchart5.Checked && !this.chkchart6.Checked && !this.chkchart7.Checked && !this.chkchart8.Checked && !this.chkchart9.Checked)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Rpt_selchart, new string[0]));
                return;
            }
            if (this.chkchart3.Checked || this.chkchart5.Checked || this.chkchart8.Checked)
            {
                if (this.txtco2_elec.Text.Length == 0)
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Rpt_needCo2, new string[0]));
                    this.txtco2_elec.Focus();
                    return;
                }
                if (!Ecovalidate.NumberFormat_double(this.txtco2_elec))
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Comm_invalidNumber, new string[0]));
                    return;
                }
            }
            if (this.chkchart4.Checked || this.chkchart8.Checked)
            {
                if (this.txtprice_elec.Text.Length == 0)
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Rpt_needEctCost, new string[0]));
                    this.txtprice_elec.Focus();
                    return;
                }
                if (!Ecovalidate.NumberFormat_double(this.txtprice_elec))
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Comm_invalidNumber, new string[0]));
                    return;
                }
            }
            if (this.chkchart5.Checked || this.chkchart8.Checked)
            {
                if (this.txtprice_co2.Text.Length == 0)
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Rpt_needCo2Cost, new string[0]));
                    this.txtprice_co2.Focus();
                    return;
                }
                if (!Ecovalidate.NumberFormat_double(this.txtprice_co2))
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Comm_invalidNumber, new string[0]));
                    return;
                }
            }
            if (this.chkchart9.Checked)
            {
                EGenRptSetPUE eGenRptSetPUE = new EGenRptSetPUE(this.grouplist.Items);
                DialogResult  dialogResult  = eGenRptSetPUE.ShowDialog();
                if (dialogResult == DialogResult.Cancel)
                {
                    return;
                }
            }
            string text = "";

            switch (this.cboperiod.SelectedIndex)
            {
            case 0:
                text += "Report Type: Hour";
                break;

            case 1:
                text += "Report Type: Day";
                break;

            case 2:
                text += "Report Type: Month";
                break;

            case 3:
                text += "Report Type: Quarter";
                break;
            }
            object obj = text;

            text = string.Concat(new object[]
            {
                obj,
                " | Start: ",
                this.BeginText,
                " | Duration: ",
                this.Cboduration
            });
            DebugCenter.GetInstance().appendToFile("PowerAnalysis Begin. | " + text);
            this.m_parent.showRpt(2, 0);
        }
Ejemplo n.º 29
0
 private void btnsaveDB_Click(object sender, System.EventArgs e)
 {
     if (!this.DBparaCheck())
     {
         return;
     }
     if (!this.checkBoxUseMySQL.Checked)
     {
         DialogResult dialogResult = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.DB_ChangeCrm, new string[0]), MessageBoxButtons.OKCancel);
         if (dialogResult == DialogResult.Cancel)
         {
             return;
         }
         AccessDBUpdate.InitAccessDataDB();
         DBUtil.ChangeDBSetting2Access();
         base.DialogResult = DialogResult.OK;
         return;
     }
     else
     {
         string   text  = this.tbDBIP.Text;
         int      num   = System.Convert.ToInt32(this.tbDBPort.Text);
         string   text2 = this.tbDBUsrnm.Text;
         string   text3 = this.tbDBPsw.Text;
         string[] param = new string[]
         {
             text,
             this.tbDBPort.Text,
             text2,
             text3
         };
         progressPopup progressPopup = new progressPopup("Information", 1, EcoLanguage.getMsg(LangRes.PopProgressMsg_Checkdbconnect, new string[0]), null, new progressPopup.ProcessInThread(this.dbCheckParameter), param, 0);
         progressPopup.ShowDialog();
         object return_V = progressPopup.Return_V;
         int?   num2     = return_V as int?;
         if (!num2.HasValue)
         {
             num2 = new int?(DebugCenter.ST_Unknown);
         }
         if (num2 == DebugCenter.ST_Success)
         {
             DBUtil.ChangeDBSetting2MySQL(text, num, text2, text3, false);
             base.DialogResult = DialogResult.OK;
             return;
         }
         if (num2 == DebugCenter.ST_MYSQLCONNECT_ERROR || num2 == DebugCenter.ST_MYSQLAUTH_ERROR || num2 == DebugCenter.ST_Unknown)
         {
             EcoMessageBox.ShowError(this, EcoLanguage.getMsg(LangRes.DB_Connectfail, new string[0]));
             return;
         }
         DialogResult dialogResult2 = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.DBinitcrm_Master, new string[0]), MessageBoxButtons.OKCancel);
         if (dialogResult2 == DialogResult.Cancel)
         {
             return;
         }
         string dbname = "";
         int    num3   = DBMaintain.InitMySQLDatabase4Master(text, num, text2, text3, ref dbname);
         if (num3 > 0)
         {
             num3 = DBUtil.ChangeDBSetting2MySQL(dbname, text, num, text2, text3);
             if (num3 == 1)
             {
                 num3 = DebugCenter.ST_Success;
             }
         }
         if (num3 == DebugCenter.ST_Success)
         {
             base.DialogResult = DialogResult.OK;
             return;
         }
         EcoMessageBox.ShowError(this, EcoLanguage.getMsg(LangRes.OPfail, new string[0]));
         return;
     }
 }
Ejemplo n.º 30
0
        private void btnsavePort_Click(object sender, System.EventArgs e)
        {
            if (!this.tbManagerPort.Visible)
            {
                int num  = 0;
                int num2 = 0;
                int num3 = 0;
                if (this.tbTrapPort.Visible)
                {
                    if (!this.portparacheck(this.lbTrapPort, this.tbTrapPort, 1))
                    {
                        return;
                    }
                    num = System.Convert.ToInt32(this.tbTrapPort.Text);
                }
                if (this.tbBillingPort.Visible)
                {
                    if (!this.portparacheck(this.lbBillingPort, this.tbBillingPort, 3))
                    {
                        return;
                    }
                    num2 = System.Convert.ToInt32(this.tbBillingPort.Text);
                    if (num2 == num)
                    {
                        this.tbBillingPort.Focus();
                        EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Portconflict, new string[]
                        {
                            this.tbBillingPort.Text
                        }));
                        return;
                    }
                }
                if (this.tbGatewayPort.Visible)
                {
                    if (!this.portparacheck(this.lbGatewayPort, this.tbGatewayPort, 2))
                    {
                        return;
                    }
                    num3 = System.Convert.ToInt32(this.tbGatewayPort.Text);
                    if (num3 == num || num3 == num2)
                    {
                        this.tbGatewayPort.Focus();
                        EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Portconflict, new string[]
                        {
                            this.tbGatewayPort.Text
                        }));
                        return;
                    }
                }
                if (this.tbTrapPort.Visible)
                {
                    new Sys_Para
                    {
                        TrapPort = num
                    }.update();
                    string valuePair = ValuePairs.getValuePair("Username");
                    if (!string.IsNullOrEmpty(valuePair))
                    {
                        LogAPI.writeEventLog("0130022", new string[]
                        {
                            valuePair
                        });
                    }
                    else
                    {
                        LogAPI.writeEventLog("0130022", new string[0]);
                    }
                }
                if (this.tbBillingPort.Visible)
                {
                    Sys_Para.SetBPPort(num2);
                    InSnergyService.RestartBillingProtocol(Sys_Para.GetBPFlag() == 1, num2, Sys_Para.GetBPSecurity());
                }
                if (this.tbGatewayPort.Visible)
                {
                    Sys_Para.SetISGPort(num3);
                    if (Sys_Para.GetISGFlag() == 0)
                    {
                        InSnergyService.Restart(false, num3);
                    }
                    else
                    {
                        InSnergyService.Restart(true, num3);
                    }
                }
                base.DialogResult = DialogResult.OK;
                return;
            }
            if (!this.portparacheck(this.lbManagerPort, this.tbManagerPort, 0))
            {
                return;
            }
            int value = System.Convert.ToInt32(this.tbManagerPort.Text);

            ValuePairs.setValuePair("ServicePort", System.Convert.ToString(value));
            ValuePairs.SaveValueKeyToRegistry(true);
            base.DialogResult = DialogResult.OK;
        }