Пример #1
0
        /// <summary>
        /// Finally when the client made the changes that he wants the program checks if all the fields
        /// all fields are fill. If all fields are fill then the program exec the apropriate querry for the
        /// update of the rating, else show a error message.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSelect_Click(object sender, EventArgs e)
        {
            LblRatingValue.Show();
            LblComment.Show();
            LblUsername.Show();

            TbxComment.Show();
            TbxRatingValue.Show();
            CmbUsername.Show();

            BtnEdit.Show();

            LblSelect.Hide();
            CmbSelect.Hide();
            BtnSelect.Hide();


            SelectedData        = DCom.GetData(String.Format(SqlExec, CmbSelect.SelectedValue));
            TbxRatingValue.Text = SelectedData.Rows[0]["Rating_Value"].ToString();
            TbxComment.Text     = SelectedData.Rows[0]["Comment"].ToString();

            CmbUsername.DataSource    = DCom.GetData("SELECT * FROM users");
            CmbUsername.DisplayMember = "Username";
            CmbUsername.ValueMember   = "Username";
        }
Пример #2
0
        /// <summary>
        /// When the client select the rating that wants to edit the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form and then the neccesarily labels, tetxboxes and comboboxes are pop up. Then fills all the fields with
        /// the data of the selected rating.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSelect_Click(object sender, EventArgs e)
        {
            LblBusiness.Show();
            LblDate.Show();
            LblPerson.Show();
            LblUsername.Show();
            CmbBusiness.Show();
            CmbUsername.Show();
            BtnEdit.Show();
            TbxPerson.Show();
            DtpDate.Show();

            LblSelect.Hide();
            CmbSelect.Hide();
            BtnSelect.Hide();

            SelectedData   = DCom.GetData(String.Format(SqlExec, CmbSelect.SelectedValue));
            TbxPerson.Text = SelectedData.Rows[0]["Persons"].ToString();

            CmbBusiness.DataSource    = DCom.GetData("SELECT businesses.ID, CONCAT(businesses.Business_Name, ', ', location.Address_Name, ', ', location.Municipality) AS NAME FROM businesses, location WHERE businesses.Location_ID = location.ID");
            CmbBusiness.DisplayMember = "NAME";
            CmbBusiness.ValueMember   = "ID";

            CmbUsername.DataSource    = DCom.GetData("SELECT * FROM users");
            CmbUsername.DisplayMember = "Username";
            CmbUsername.ValueMember   = "Username";

            CmbUsername.Text = SelectedData.Rows[0]["User"].ToString();
            CmbBusiness.Text = SelectedData.Rows[0]["BusinessID"].ToString();
        }
Пример #3
0
        public MainWindow()
        {
            InitializeComponent();

            BtnEdit.SetIcon(global::CarSensX.Properties.Resources.iconEdit);
            BtnFullScreen.SetIcon(global::CarSensX.Properties.Resources.iconFullScreen);
            BtnExit.SetIcon(global::CarSensX.Properties.Resources.iconBack);

            BtnExit.SetLabel("Exit");
            BtnFullScreen.SetLabel("Fullscreen");
            BtnEdit.SetLabel("Configure");
            BtnBackground.SetLabel("Set Background");

            BtnEdit.MouseLeftButtonUp       += new MouseButtonEventHandler(BtnEditClick);
            BtnFullScreen.MouseLeftButtonUp += new MouseButtonEventHandler(BtnFullScreenClick);
            BtnBackground.MouseLeftButtonUp += new MouseButtonEventHandler(BtnBackgroundClick);
            BtnExit.MouseLeftButtonUp       += new MouseButtonEventHandler(BtnExitClick);

            if (global::CarSensX.Properties.Settings.Default.BackgroundImage != null)
            {
                String fileName = global::CarSensX.Properties.Settings.Default.BackgroundImage;
                try
                {
                    BitmapImage iSource = new BitmapImage(new Uri(fileName));
                    BackgroundGrid.Background = new ImageBrush(iSource);
                }
                catch (Exception ex)
                {
                }
            }
        }
Пример #4
0
        private void BtnEdit_Click(object sender, EventArgs e)
        {
            try

            {
                DialogResult dialog = MessageBox.Show("هل انت متأكد من انك تريد تعديل البيانات؟", "واى إن للبرمجيات", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialog == DialogResult.No)
                {
                    return;
                }
                if (TxtItemId.Text == string.Empty || TxtItemName.Text == string.Empty || TxtBarCode.Text == string.Empty ||
                    TxtPurPrice.Text == string.Empty || TxtSalePrice.Text == string.Empty || TxtQTE.Text == string.Empty ||
                    TxtDiscount.Text == string.Empty || Cmb_CatID.SelectedItem == null)
                {
                    MessageBox.Show("بعض الخانات فارغة !!", "واى إن للبرمجيات", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                ClsItems.updateItems(Convert.ToInt32(TxtItemId.Text), TxtBarCode.Text, TxtItemName.Text, DateAdded.DateTime, Convert.ToDouble(TxtPurPrice.Text),
                                     Convert.ToDouble(TxtSalePrice.Text), Convert.ToDouble(TxtQTE.Text), Convert.ToDouble(TxtDiscount.Text), Convert.ToInt32(Cmb_CatID.SelectedValue), Convert.ToInt32(CmbStock.SelectedIndex + 1));
                MessageBox.Show("تم تعديل الصنف بنجاح", "واى إن للبرمجيات", MessageBoxButtons.OK, MessageBoxIcon.Information);
                BtnNew.Visible   = false;
                BtnAdd.Visible   = false;
                BtnEdit.Location = new Point(299, 19);
                BtnEdit.BringToFront();
                clear();
            }
            catch
            {
                return;
            }
        }
Пример #5
0
        private void BtnSelect_Click(object sender, EventArgs e)
        {
            LblBusinessDescription.Show();
            LblBusinessName.Show();
            LblCategory.Show();
            LblPrice.Show();
            LblRating.Show();
            LblTelephone.Show();
            LblUser.Show();
            LblWebsite.Show();
            LblWorkHours.Show();
            LblBusinessType.Show();
            LblLocation.Show();

            TbxBusinessName.Show();
            TbxCategory.Show();
            TbxDescription.Show();
            TbxPrice.Show();
            TbxRating.Show();
            TbxTelephone.Show();
            TbxWebsite.Show();

            CmbLocation.Show();
            CmbTypes.Show();
            CmbUser.Show();
            CmbWorkHours.Show();

            ChbReservation.Show();

            BtnEdit.Show();

            LblSelect.Hide();
            CmbBusinesses.Hide();
            BtnSelect.Hide();

            SelectedData         = DCom.GetData(String.Format(SqlExec, CmbBusinesses.SelectedValue));
            TbxBusinessName.Text = (string)SelectedData.Rows[0]["Business_Name"];
            TbxCategory.Text     = (string)SelectedData.Rows[0]["Category"];
            TbxDescription.Text  = (string)SelectedData.Rows[0]["Description"];
            TbxPrice.Text        = SelectedData.Rows[0]["Price_Range"].ToString();
            TbxRating.Text       = (string)SelectedData.Rows[0]["Rating"].ToString();
            TbxTelephone.Text    = (string)SelectedData.Rows[0]["Telephone"];
            TbxWebsite.Text      = (string)SelectedData.Rows[0]["Website"];

            CmbLocation.DataSource    = DCom.GetData("SELECT ID,CONCAT(Address_Name, ', ', Address_Number) AS NAME FROM location");
            CmbLocation.DisplayMember = "NAME";
            CmbLocation.ValueMember   = "ID";

            CmbTypes.DataSource    = DCom.GetData("SELECT * FROM businesses_types");
            CmbTypes.DisplayMember = "Type";
            CmbTypes.ValueMember   = "Type";

            CmbUser.DataSource    = DCom.GetData("SELECT * FROM users");
            CmbUser.DisplayMember = "Username";
            CmbUser.ValueMember   = "Username";

            CmbWorkHours.DataSource    = DCom.GetData("SELECT * FROM work_hours");
            CmbWorkHours.DisplayMember = "ID";
            CmbWorkHours.ValueMember   = "ID";
        }
Пример #6
0
        /// <summary>
        /// When the client select the user that wants to edit the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form and then the neccesarily labels, tetxboxes and comboboxes are pop up. Then fills all the fields with
        /// the data of the selected user.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSelect_Click(object sender, EventArgs e)
        {
            label2.Show();
            label3.Show();
            label4.Show();
            label5.Show();
            label6.Show();
            label7.Show();
            TbxAddressNumber.Show();
            TbxAdressName.Show();
            TbxLat.Show();
            TbxLong.Show();
            TbxPostalCode.Show();
            CmbMunicipality.Show();
            BtnEdit.Show();

            label1.Hide();
            CmbLocation.Hide();
            BtnSelect.Hide();

            SelectedData          = DCom.GetData(String.Format(SqlExec, CmbLocation.SelectedValue));
            TbxAdressName.Text    = SelectedData.Rows[0]["Address_Name"].ToString();
            TbxAddressNumber.Text = SelectedData.Rows[0]["Address_Number"].ToString();
            TbxLat.Text           = SelectedData.Rows[0]["Lat"].ToString();
            TbxLong.Text          = SelectedData.Rows[0]["Long"].ToString();
            TbxPostalCode.Text    = SelectedData.Rows[0]["Postal_Code"].ToString();

            CmbMunicipality.DataSource    = DCom.GetData("SELECT * FROM municipality");
            CmbMunicipality.DisplayMember = "Municipality_Name";
            CmbMunicipality.ValueMember   = "Municipality_Name";
            CmbMunicipality.Text          = SelectedData.Rows[0]["Municipality"].ToString();
        }
Пример #7
0
        /// <summary>
        /// When the client select the user that wants to edit the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form and then the neccesarily labels, tetxboxes and comboboxes are pop up. Then fills all the fields with
        /// the data of the selected user.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSelect_Click(object sender, EventArgs e)
        {
            Guidelbl.Hide();
            CmbUser.Hide();
            BtnSelect.Hide();
            label1.Show();
            label2.Show();
            label3.Show();
            label4.Show();
            label5.Show();
            label6.Show();
            TbxFirstName.Show();
            TbxLastName.Show();
            TbxUsername.Show();
            TbxTelephone.Show();
            TbxEmail.Show();
            CmbTypes.Show();
            BtnEdit.Show();

            SelectedData      = DCom.GetData(String.Format(SqlExec, CmbUser.SelectedValue));
            TbxFirstName.Text = (string)SelectedData.Rows[0]["First_Name"];
            TbxLastName.Text  = (string)SelectedData.Rows[0]["Last_Name"];
            TbxUsername.Text  = (string)SelectedData.Rows[0]["Username"];
            TbxEmail.Text     = (string)SelectedData.Rows[0]["Email"];
            TbxTelephone.Text = (string)SelectedData.Rows[0]["Telephone"];

            DataTable GetUserType = DCom.GetData(String.Format("SELECT users_types.Type FROM users, users_types WHERE users.Username='******' and users.Type=users_types.Type", CmbUser.SelectedValue));

            CmbTypes.DataSource    = DCom.GetData("SELECT * FROM users_types");
            CmbTypes.DisplayMember = "Type";
            CmbTypes.ValueMember   = "Type";
            CmbTypes.Text          = (string)GetUserType.Rows[0]["Type"];
        }
Пример #8
0
        void ReleaseDesignerOutlets()
        {
            if (BtnDelete != null)
            {
                BtnDelete.Dispose();
                BtnDelete = null;
            }

            if (BtnEdit != null)
            {
                BtnEdit.Dispose();
                BtnEdit = null;
            }

            if (LblAccountNameTilte != null)
            {
                LblAccountNameTilte.Dispose();
                LblAccountNameTilte = null;
            }

            if (LblAccountNameValue != null)
            {
                LblAccountNameValue.Dispose();
                LblAccountNameValue = null;
            }

            if (LblBaseAmountTitle != null)
            {
                LblBaseAmountTitle.Dispose();
                LblBaseAmountTitle = null;
            }

            if (LblBaseAmountValue != null)
            {
                LblBaseAmountValue.Dispose();
                LblBaseAmountValue = null;
            }

            if (LblItemTitle != null)
            {
                LblItemTitle.Dispose();
                LblItemTitle = null;
            }

            if (LblTaxTitle != null)
            {
                LblTaxTitle.Dispose();
                LblTaxTitle = null;
            }

            if (LblTaxValue != null)
            {
                LblTaxValue.Dispose();
                LblTaxValue = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (TxtNameAdmin != null)
            {
                TxtNameAdmin.Dispose();
                TxtNameAdmin = null;
            }

            if (TxtAddressAdmin != null)
            {
                TxtAddressAdmin.Dispose();
                TxtAddressAdmin = null;
            }

            if (TxtPhoneAdmin != null)
            {
                TxtPhoneAdmin.Dispose();
                TxtPhoneAdmin = null;
            }

            if (BtnDisableAccount != null)
            {
                BtnDisableAccount.Dispose();
                BtnDisableAccount = null;
            }

            if (BtnEdit != null)
            {
                BtnEdit.Dispose();
                BtnEdit = null;
            }

            if (BtnEnableAccount != null)
            {
                BtnEnableAccount.Dispose();
                BtnEnableAccount = null;
            }

            if (ImgProfilePicture != null)
            {
                ImgProfilePicture.Dispose();
                ImgProfilePicture = null;
            }

            if (LblChange != null)
            {
                LblChange.Dispose();
                LblChange = null;
            }

            if (ViewProfilePicture != null)
            {
                ViewProfilePicture.Dispose();
                ViewProfilePicture = null;
            }
        }
Пример #10
0
        /// <summary>
        /// In forms constructor the not necessarily labels and tetxboxes are hiding
        /// from the form. Then the combobox for businesses types(CmbBusinessesTypes) is filling
        /// from the businesses types(businesses_types) table.
        /// /// </summary>
        public EditBusinessesTypes()
        {
            InitializeComponent();
            BtnEdit.Hide();
            LblGuide1.Hide();
            TbxEditiBusinessesTypes.Hide();

            CmbBusinessesTypes.DataSource    = DCom.GetData("SELECT * FROM businesses_types");
            CmbBusinessesTypes.DisplayMember = "Type";
            CmbBusinessesTypes.ValueMember   = "Type";
        }
Пример #11
0
        /// <summary>
        /// When the client select the user type that wants to edit the not necessarily labels and comboboxes are hiding
        /// from the form and then the neccesarily labels and tetxboxes are pop up. Then fills all the fields with
        /// the data of the selected user type.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSelect_Click(object sender, EventArgs e)
        {
            BtnEdit.Show();
            LblGuide1.Show();
            TbxEditiBusinessesTypes.Show();
            BtnSelect.Hide();
            CmbBusinessesTypes.Hide();
            LblGuide.Hide();

            SelectedData = DCom.GetData(String.Format(SqlExec, CmbBusinessesTypes.SelectedValue));
            TbxEditiBusinessesTypes.Text = (string)SelectedData.Rows[0]["Type"];
        }
Пример #12
0
        private void BtnSelect_Click(object sender, EventArgs e)
        {
            TbxDays.Show();
            BtnEdit.Show();
            label2.Show();
            label3.Hide();
            CmbDays.Hide();
            BtnSelect.Hide();

            SelectedData = DCom.GetData(String.Format(SqlExec, CmbDays.SelectedValue));
            TbxDays.Text = (string)SelectedData.Rows[0]["Name"];
        }
Пример #13
0
        /// <summary>
        /// In forms constructor the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form. Then the combobox for province(comboBoxptovince) is filling with the data from table province.
        /// </summary>
        public EditProvince()
        {
            InitializeComponent();

            TbxProvinceName.Hide();
            labelpro.Hide();
            BtnEdit.Hide();

            comboBoxptovince.DataSource    = DCom.GetData("SELECT * FROM province");
            comboBoxptovince.DisplayMember = "Province_Name";
            comboBoxptovince.ValueMember   = "Province_Name";
        }
Пример #14
0
        public Frm_AddItems()
        {
            InitializeComponent();
            LoadComboBox();
            BtnAdd.Enabled = false;
            Status.Visible = false;
            panel1.SendToBack();
            BtnEdit.SendToBack();
            var dateNow = DateTime.Now;
            var date    = new DateTime(dateNow.Year, dateNow.Month, dateNow.Day);

            DateAdded.DateTime = dateNow;
        }
Пример #15
0
        /// <summary>
        /// In forms constructor the not necessarily labels and tetxboxes are hiding
        /// from the form. Then the combobox for login(CmbUsername) is filling
        /// from the user types(users_types) table.
        /// /// </summary>
        public EditLogin()
        {
            InitializeComponent();
            guidelbl.Hide();
            label2.Hide();
            TbxUsername.Hide();
            TbxPassword.Hide();
            BtnEdit.Hide();

            CmbUsername.DataSource    = DCom.GetData("SELECT * FROM login");
            CmbUsername.DisplayMember = "Username";
            CmbUsername.ValueMember   = "Username";
        }
Пример #16
0
        /// <summary>
        /// In forms constructor the not necessarily labels and tetxboxes are hiding
        /// from the form. Then the combobox for municipality(CmbMunicipality_Name) is filling
        /// from the municipality(municipality) table.
        /// /// </summary>
        public EditMunicipality()
        {
            InitializeComponent();
            guidelbl.Hide();
            label2.Hide();
            TbxName.Hide();
            CmbProvince.Hide();
            BtnEdit.Hide();

            CmbMunicipality_Name.DataSource    = DCom.GetData("SELECT * FROM municipality");
            CmbMunicipality_Name.DisplayMember = "Municipality_Name";
            CmbMunicipality_Name.ValueMember   = "Municipality_Name";
        }
Пример #17
0
        /// <summary>
        /// When the client select the privince that wants to edit the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form and then the neccesarily labels, tetxboxes and comboboxes are pop up. Then fills all the fields with
        /// the data of the selected province.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnselect_Click(object sender, EventArgs e)
        {
            label2.Hide();
            comboBoxptovince.Hide();
            TbxProvinceName.Hide();
            btnselect.Hide();
            labelpro.Show();
            TbxProvinceName.Show();
            BtnEdit.Show();

            SelectedData         = DCom.GetData(String.Format(SqlExec, comboBoxptovince.SelectedValue));
            TbxProvinceName.Text = (string)SelectedData.Rows[0]["Province_Name"];
        }
Пример #18
0
        public FrmAddReturn()
        {
            InitializeComponent();
            BtnAdd.Enabled = false;
            BtnEdit.SendToBack();
            txtBarCode.Focus();
            var dateNow = DateTime.Now;
            var date    = new DateTime(dateNow.Year, dateNow.Month, dateNow.Day);

            DateReturn.DateTime = dateNow;
            UserReturn.Text     = Program.UserName;
            Status.Visible      = false;
            StatusProv.Visible  = false;
            BtnAprof.SendToBack();
        }
Пример #19
0
        /// <summary>
        /// In forms constructor the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form. Then the combobox for work hours(CmbWorkHours) is filling with the ID of work hours.
        /// </summary>
        public EditWorkHours()
        {
            InitializeComponent();

            LblDays.Hide();
            LblEndTime.Hide();
            LblStartTime.Hide();
            DtpEndTime.Hide();
            DtpStartTime.Hide();
            CmbDays.Hide();
            BtnEdit.Hide();

            CmbWorkHours.DataSource    = DCom.GetData("SELECT * FROM work_hours");
            CmbWorkHours.DisplayMember = "ID";
            CmbWorkHours.ValueMember   = "ID";
        }
Пример #20
0
        /// <summary>
        /// When the client select the login that wants to edit the not necessarily labels and comboboxes are hiding
        /// from the form and then the neccesarily labels and tetxboxes are pop up. Then fills all the fields with
        /// the data of the selected login.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSelect_Click(object sender, EventArgs e)
        {
            guidelbl.Show();
            label2.Show();
            TbxUsername.Show();
            TbxPassword.Show();
            BtnEdit.Show();

            label1.Hide();
            CmbUsername.Hide();
            BtnSelect.Hide();

            SelectedData = DCom.GetData(String.Format(SqlExec, CmbUsername.SelectedValue));

            TbxUsername.Text = (string)SelectedData.Rows[0]["Username"];
            TbxPassword.Text = (string)SelectedData.Rows[0]["Password"];
        }
Пример #21
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
            case (Keys.Control | Keys.N):
            {
                BtnAddNew.PerformClick(); break;
            }

            case (Keys.Control | Keys.E):
            {
                BtnEdit.PerformClick(); break;
            }

            case (Keys.Control | Keys.D):
            {
                BtnDelete.PerformClick(); break;
            }

            case (Keys.Control | Keys.S):
            {
                BtnSave.PerformClick(); break;
            }

            case (Keys.Control | Keys.U):
            {
                BtnUndo.PerformClick(); break;
            }

            case (Keys.Control | Keys.F):
            {
                BtnFind.PerformClick(); break;
            }

            case (Keys.Control | Keys.R):
            {
                BtnReload.PerformClick(); break;
            }

            case (Keys.Control | Keys.P):
            {
                BtnPrint.PerformClick(); break;
            }
            }
            return(base.ProcessCmdKey(ref msg, keyData));
        }
Пример #22
0
        /// <summary>
        /// In forms constructor the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form. Then the combobox for ratings(CmbSelect) is filling with the data of the table.
        /// </summary>
        public EditRatingsForm()
        {
            InitializeComponent();

            LblRatingValue.Hide();
            LblComment.Hide();
            LblUsername.Hide();

            TbxComment.Hide();
            TbxRatingValue.Hide();
            CmbUsername.Hide();

            BtnEdit.Hide();

            CmbSelect.DataSource    = DCom.GetData("SELECT *, CONCAT(Username, ', ', Rating_Value) AS NAME FROM ratings");
            CmbSelect.DisplayMember = "NAME";
            CmbSelect.ValueMember   = "ID";
        }
        void ReleaseDesignerOutlets()
        {
            if (ImgProfile != null)
            {
                ImgProfile.Dispose();
                ImgProfile = null;
            }

            if (ImgBottom != null)
            {
                ImgBottom.Dispose();
                ImgBottom = null;
            }

            if (LblProfile != null)
            {
                LblProfile.Dispose();
                LblProfile = null;
            }

            if (LblBottom != null)
            {
                LblBottom.Dispose();
                LblBottom = null;
            }

            if (BtnEdit != null)
            {
                BtnEdit.Dispose();
                BtnEdit = null;
            }

            if (ViewProfile != null)
            {
                ViewProfile.Dispose();
                ViewProfile = null;
            }

            if (ViewBottom != null)
            {
                ViewBottom.Dispose();
                ViewBottom = null;
            }
        }
Пример #24
0
        void ReleaseDesignerOutlets()
        {
            if (BtnEdit != null)
            {
                BtnEdit.Dispose();
                BtnEdit = null;
            }

            if (CoverView != null)
            {
                CoverView.Dispose();
                CoverView = null;
            }

            if (ImgCover != null)
            {
                ImgCover.Dispose();
                ImgCover = null;
            }

            if (ImgProfile != null)
            {
                ImgProfile.Dispose();
                ImgProfile = null;
            }

            if (LblCover != null)
            {
                LblCover.Dispose();
                LblCover = null;
            }

            if (lblEdit != null)
            {
                lblEdit.Dispose();
                lblEdit = null;
            }

            if (ProfileView != null)
            {
                ProfileView.Dispose();
                ProfileView = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (BtnEdit != null)
            {
                BtnEdit.Dispose();
                BtnEdit = null;
            }

            if (ImgProfilePicture != null)
            {
                ImgProfilePicture.Dispose();
                ImgProfilePicture = null;
            }

            if (LblChange != null)
            {
                LblChange.Dispose();
                LblChange = null;
            }

            if (TxtAddress != null)
            {
                TxtAddress.Dispose();
                TxtAddress = null;
            }

            if (TxtName != null)
            {
                TxtName.Dispose();
                TxtName = null;
            }

            if (TxtPhone != null)
            {
                TxtPhone.Dispose();
                TxtPhone = null;
            }

            if (ViewProfilePicture != null)
            {
                ViewProfilePicture.Dispose();
                ViewProfilePicture = null;
            }
        }
Пример #26
0
        /// <summary>
        /// When the client select the minicipality that wants to edit the not necessarily labels and comboboxes are hiding
        /// from the form and then the neccesarily labels and tetxboxes are pop up. Then fills all the fields with
        /// the data of the selected municipality.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSelect_Click(object sender, EventArgs e)
        {
            label2.Show();
            TbxName.Show();
            CmbProvince.Show();
            guidelbl.Show();
            BtnEdit.Show();

            label1.Hide();
            CmbMunicipality_Name.Hide();
            BtnSelect.Hide();

            SelectedData = DCom.GetData(String.Format(SqlExec, CmbMunicipality_Name.SelectedValue));
            TbxName.Text = (string)SelectedData.Rows[0]["Municipality_Name"];

            CmbProvince.DataSource    = DCom.GetData("SELECT * FROM province");
            CmbProvince.DisplayMember = "Province_Name";
            CmbProvince.ValueMember   = "Province_Name";
            CmbProvince.Text          = (string)SelectedData.Rows[0]["Province"];;
        }
Пример #27
0
        /// <summary>
        /// In forms constructor the not necessarily labels and tetxboxes are hiding
        /// from the form. Then the combobox for ratings(CmbSelect) is filling
        /// from the rating(rating) table.
        /// </summary>
        public EditReservationForm()
        {
            InitializeComponent();

            LblBusiness.Hide();
            LblDate.Hide();
            LblPerson.Hide();
            LblUsername.Hide();

            CmbBusiness.Hide();
            CmbUsername.Hide();

            BtnEdit.Hide();

            TbxPerson.Hide();
            DtpDate.Hide();

            CmbSelect.DataSource    = DCom.GetData("SELECT *, CONCAT(Username, ', ', Rating_Value) AS NAME FROM ratings");
            CmbSelect.DisplayMember = "NAME";
            CmbSelect.ValueMember   = "ID";
        }
Пример #28
0
        /// <summary>
        /// In forms constructor the not necessarily labels, tetxboxes and comboboxes are hiding
        /// from the form. Then the combobox for users(CmbUser) is filling with the usernames and NAMES
        /// from table users.
        /// </summary>
        public EditUser()
        {
            InitializeComponent();
            label1.Hide();
            label2.Hide();
            label3.Hide();
            label4.Hide();
            label5.Hide();
            label6.Hide();
            TbxFirstName.Hide();
            TbxLastName.Hide();
            TbxUsername.Hide();
            TbxTelephone.Hide();
            TbxEmail.Hide();
            CmbTypes.Hide();
            BtnEdit.Hide();

            CmbUser.DataSource    = DCom.GetData("SELECT Username,CONCAT(Last_name,' ' , First_Name) AS NAME FROM users");
            CmbUser.DisplayMember = "NAME";
            CmbUser.ValueMember   = "Username";
        }
Пример #29
0
        public void Nav(Form form, Panel panel)
        {
            // changing view for content panel
            form.TopLevel = false;
            form.Size     = panel.Size; // for responsive size
            panel.Controls.Clear();
            panel.Controls.Add(form);
            form.Show();

            // getting name of form that is being viewed, and assigning header title and button text from from that value
            nameOfFormOpen = form.Name;
            string currTitle = "";
            string newTitle  = "";

            // removing value "GUI" from name to be more user friendly
            if (nameOfFormOpen.Contains("GUI"))
            {
                currTitle = nameOfFormOpen.Replace("GUI", "");
                newTitle  = InsertSpaceBeforeUpperCase(currTitle);
            }
            lblNameOfFormOpen.Text = newTitle;

            ChangeButtons(newTitle.ToLower());
            if (nameOfFormOpen.Equals("DashboardGUI") || nameOfFormOpen.Equals("VenuesGUI"))
            {
                //if (nameOfFormOpen.Equals("DashboardGUI")) {
                HideButtons();
            }
            else if (nameOfFormOpen.Equals("ReservationsGUI"))
            {
                BtnCreateNew.Hide();
                BtnEdit.Hide();
                BtnDelete.Show();
            }
            else
            {
                ShowButtons();
            }
        }
Пример #30
0
        /// <summary>
        /// In forms constructor the not necessarily labels and tetxboxes are hiding
        /// from the form. Then the combobox for location(CmbLocation) is filling
        /// from the location(location) table.
        /// </summary>
        public EditLocation()
        {
            InitializeComponent();

            label2.Hide();
            label3.Hide();
            label4.Hide();
            label5.Hide();
            label6.Hide();
            label7.Hide();
            TbxAddressNumber.Hide();
            TbxAdressName.Hide();
            TbxLat.Hide();
            TbxLong.Hide();
            TbxPostalCode.Hide();
            CmbMunicipality.Hide();
            BtnEdit.Hide();

            CmbLocation.DataSource    = DCom.GetData("SELECT ID, CONCAT(Address_Name, ', ', Municipality) AS ADDRESS  FROM location");
            CmbLocation.DisplayMember = "ADDRESS";
            CmbLocation.ValueMember   = "ID";
        }