private void btnOK_Click(object sender, EventArgs e) { if (!ValidateData()) { return; } int old_sess_id = _user != null ? _user.SessionId : -1; _user = new EIBUserConf(); _user.SessionId = old_sess_id; _user.Name = this.tbUserName.Text; _user.Password = this.tbmaskPassword.Text; _user.Priviliges = 0; if (this.cbReadAllowed.Checked) { _user.Priviliges |= EIBUsersConf.USER_POLICY_READ_ACCESS; } if (this.cbWriteAllowed.Checked) { _user.Priviliges |= EIBUsersConf.USER_POLICY_WRITE_ACCESS; } if (this.cbConsoleAccss.Checked) { _user.Priviliges |= EIBUsersConf.USER_POLICY_CONSOLE_ACCESS; } _user.SrcMask = ushort.Parse(this.tbSAMask.Text.Substring(2, this.tbSAMask.Text.Length - 2), System.Globalization.NumberStyles.HexNumber); _user.DstMask = ushort.Parse(this.tbDAMask.Text.Substring(2, this.tbDAMask.Text.Length - 2), System.Globalization.NumberStyles.HexNumber); }
public AddUserForm(EIBUserConf user) { InitializeComponent(); _user = user; this.tbUserName.Text = _user.Name; this.tbmaskPassword.Text = _user.Password; this.tbmaskRetypePassword.Text = _user.Password; this.cbReadAllowed.Checked = (_user.Priviliges & EIBUsersConf.USER_POLICY_READ_ACCESS) != 0; this.cbWriteAllowed.Checked = (_user.Priviliges & EIBUsersConf.USER_POLICY_WRITE_ACCESS) != 0; this.cbConsoleAccss.Checked = (_user.Priviliges & EIBUsersConf.USER_POLICY_CONSOLE_ACCESS) != 0; this.tbSAMask.Text = "0x" + _user.SrcMask.ToString("X"); this.tbDAMask.Text = "0x" + _user.DstMask.ToString("X"); }
private void UpdatSpecificeUserSettings(EIBUserConf user) { this.cbReadPolicy.Checked = ((user.Priviliges & EIBUsersConf.USER_POLICY_READ_ACCESS) != 0); this.cbWritePolicy.Checked = ((user.Priviliges & EIBUsersConf.USER_POLICY_WRITE_ACCESS ) != 0); this.cbConsoleAccess.Checked = ((user.Priviliges & EIBUsersConf.USER_POLICY_CONSOLE_ACCESS) != 0); this.lbSrcMask.Text = "0x" + user.SrcMask.ToString("X4"); this.lblDstMask.Text = "0x" + user.DstMask.ToString("X4"); }