Ejemplo n.º 1
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";
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
0
        private void Load()
        {
            latestTransNo = transactionNumber.Fetch();

            foreach (var obj in (transaction.FetchAll()))
            {
                CmbTransactionNumbers.Add(obj.TransactionNumber);
            }
            CmbTransactionNumbers.Add(latestTransNo);

            CmbTransactionType.Add(new TransactionTypesModel());
            foreach (var type in transactionType.FetchAll())
            {
                CmbTransactionType.Add(type);
            }

            transactionDate = currentDate.ToString("MM/dd/yyyy");

            CmbWarehouse.Add(new WareHouseModel());
            foreach (var wh in warehouse.FetchAll())
            {
                CmbWarehouse.Add(wh);
            }

            CmbLocation.Add(new LocationModel());
            foreach (var loc in location.FetchAll())
            {
                CmbLocation.Add(loc);
            }

            priceCategoryList.Add("");
            priceCategoryList.Add("Selling Price");
            priceCategoryList.Add("Purchase Price");

            priceTypeList.Add("");
            priceTypeList.Add("Current");
            priceTypeList.Add("3 Months Ago");
            priceTypeList.Add("6 Months Ago");

            ReasonList = reason.FetchAll();

            EnableDestination = false;
        }
Ejemplo n.º 4
0
        public EdiBusinessForm()
        {
            InitializeComponent();

            LblBusinessDescription.Hide();
            LblBusinessName.Hide();
            LblCategory.Hide();
            LblPrice.Hide();
            LblRating.Hide();
            LblTelephone.Hide();
            LblUser.Hide();
            LblWebsite.Hide();
            LblWorkHours.Hide();
            LblBusinessType.Hide();
            LblLocation.Hide();

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

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

            ChbReservation.Hide();

            BtnEdit.Hide();

            CmbBusinesses.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");
            CmbBusinesses.DisplayMember = "NAME";
            CmbBusinesses.ValueMember   = "ID";
        }