/********************************** Constructor **********************************/ public AdminUserForm(UserController parent, Point loc) { InitializeComponent(); SetLoc(loc); my_controller = parent; SetFields(MFranchise.GetThis()); if (string.Equals(MFranchise.isFranchisor(), "true", StringComparison.OrdinalIgnoreCase)) { hqCol.Visible = true; UserGridView.Width += hqCol.Width; this.Width += hqCol.Width; addUserButton.Location = new Point(addUserButton.Location.X + hqCol.Width, addUserButton.Location.Y); BAddrGridView.Location = new Point(BAddrGridView.Location.X + hqCol.Width, BAddrGridView.Location.Y); AddAddrButton.Location = new Point(AddAddrButton.Location.X + hqCol.Width, AddAddrButton.Location.Y); label6.Location = new Point(label6.Location.X + hqCol.Width, label6.Location.Y); } UserGridView.CellContentClick += new DataGridViewCellEventHandler(my_controller.UserGridViewClick); BAddrGridView.CellContentClick += new DataGridViewCellEventHandler(my_controller.BAddrGridViewClick); SaveBtn.Click +=new EventHandler(my_controller.SaveBtn_Click); foreach (Control c in this.Controls) { try { c.TextChanged += new EventHandler(somethingChanged); } catch (Exception) { } } noChanges = true; }
/************************************* Contructor *****************************/ public MaintainUsersForm(int idOfUser, int ProPicID) { InitializeComponent(); UserID = idOfUser; picID = ProPicID; this.Back_Button.MouseEnter += new EventHandler(button1_MouseEnter); this.Back_Button.MouseLeave += new EventHandler(button1_MouseLeave); //this.Back_Button.Location = new Point(15, 15); Back_Button.BackgroundImage = ((System.Drawing.Image)(Properties.Resources.Back2)); Back_Button.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; Back_Button.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; //this.Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); my_controller = new UserController(this,idOfUser,picID); #region Handlers this.Back_Button.Click += new EventHandler(my_controller.back_Button); this.UploadPicButton.Click += new EventHandler(my_controller.UploadPic_click); this.AdminButton.Click +=new EventHandler(my_controller.AdminButton_Click); this.HQButton.Click +=new EventHandler(my_controller.HQButton_Click); this.CountryBox.SelectedValueChanged += new EventHandler(CountryBoxChanged); this.ProvStateBox.SelectedValueChanged += new EventHandler(ProvBoxChanged); this.SaveButton.Click +=new EventHandler(my_controller.SaveButton_Click); this.LocationChanged += new EventHandler(my_controller.LocationChanged); foreach (Control c in this.Controls) c.TextChanged += new EventHandler(somethingChanged); #endregion if (UserID == 1) primUsrLabel.Visible = true; noChanges = true; }
/********************************** Constructor **********************************/ public HQUserForm(UserController parent, Point Loc) { InitializeComponent(); SetLoc(Loc); my_controller = parent; LoadOpRegions(); LoadFranchiseeGridView(); InitializeCombos("1", "1", "1"); #region Handlers OpRegionCombo.SelectedValueChanged += new System.EventHandler(this.OpRegionCombo_SelectedValueChanged); CountryBox.SelectedValueChanged += new EventHandler(CountryBoxChanged); ProvBox.SelectedValueChanged +=new EventHandler(ProvBoxChanged); CityBox.SelectedValueChanged += new EventHandler(CityBoxChanged); DeleteRegionBtn.Click += new EventHandler(my_controller.DeleteRegionBtn_Click); AddRegionBtn.Click += new EventHandler(my_controller.AddRegionBtn_Click); SaveBtn.Click += new EventHandler(my_controller.HQSaveBtn_Click); #endregion noChanges = true; }