Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (txtCategory.Text != "" && ApiClass.est_add_category(txtCategory.Text, ForLoginEstVO.getEstUserID()))
     {
         MessageBox.Show("Category Add Successful!", "Add Category", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        private void cbItemName_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbItemName.Text != "")
            {
                cbCategory.Enabled = true;
                txtPrice.Enabled   = true;
                btnChange.Enabled  = true;
                btnSave.Enabled    = true;
                txtItemName.Text   = cbItemName.Text;
                ApiClass.editProduct(ForEstablishmentLogin.ForLoginEstVO.getEstUserID(), cbItemName.Text);
                cbCategory.Text = forEditProduct.forEditProductVO.getCategory();
                txtPrice.Text   = forEditProduct.forEditProductVO.getPrice();
                string path = forEditProduct.forEditProductVO.getPath();
                oldPath = path;
                String[] separated = path.Split('/');
                path = separated[6] + "/" + separated[7];
                pbThumbnail.Load("http://darkened-career.000webhostapp.com/" + path);

                if (forEditProduct.forEditProductVO.getStatus() == 1)
                {
                    cbStatus.Text = "ACTIVE";
                }
                else
                {
                    cbStatus.Text = "INACTIVE";
                }
            }
        }
Esempio n. 3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (ApiClass.add_est_type(txtEstName.Text))
     {
         MessageBox.Show("Success", "Add Establishment Type", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Esempio n. 4
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtUsername.Text != "" ||
         frontStorePicPath != "" ||
         txtPassword.Text != "" ||
         txtRePassword.Text != "" ||
         txtSecurity.Text != "" ||
         txtEstablishmentName.Text != "" ||
         txtLat.Text != "" ||
         txtLon.Text != "" ||
         cbEmotion.Text != "" && cbEmotion.Text != "----SELECT THE BEST ONE----" ||
         cbAge.Text != "" && cbAge.Text != "----SELECT THE BEST ONE----")
     {
         if (txtPassword.Text == txtRePassword.Text)
         {
             if (ApiClass.establishment_registration(txtUsername.Text, txtPassword.Text, txtEstablishmentName.Text, txtLat.Text, txtLon.Text, cbEmotion.Text, cbAge.Text, txtSecurity.Text, forEstablishmentType.ForEstablishmentTypeVO.getEstTypeID(), frontStorePicPath, txtAddress.Text))
             {
                 MessageBox.Show("Registration Success", "Registration", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 MessageBox.Show("Registration Fail", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             MessageBox.Show("Password and Re-Password Not Match", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         MessageBox.Show("Please Complete Information Needed Or;\nSelect Specific Item needed", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     // MessageBox.Show(fileInfo + "");
     if (ApiClass.addProduct(txtProductName.Text, txtPrice.Text, txtFilePath.Text, cbCategory.Text))
     {
         MessageBox.Show("Add Product Successful", "Add Product", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        public void retrieveEstType()
        {
            ArrayList type = new ArrayList();

            type = ApiClass.get_est_type("active", "");
            for (int x = 0; x < type.Count; x++)
            {
                cbEstType.Items.Add(type[x]);
            }
        }
 private void getMenuCategory()
 {
     cbCurrentCategory.Items.Clear();
     category = ApiClass.getCategory(ForLoginEstVO.getEstUserID(), "all");
     category.Sort();
     for (int x = 0; x < category.Count; x++)
     {
         cbCurrentCategory.Items.Add(category[x]);
     }
 }
        private void frmEditEstType_Load(object sender, EventArgs e)
        {
            ArrayList type = new ArrayList();

            type = ApiClass.get_est_type("all", "");
            for (int x = 0; x < type.Count; x++)
            {
                cbEstName.Items.Add(type[x]);
            }
        }
Esempio n. 9
0
        private void frmRegistration_Load(object sender, EventArgs e)
        {
            ArrayList type = new ArrayList();

            type = ApiClass.get_est_type("active", "");
            type.Sort();
            for (int x = 0; x < type.Count; x++)
            {
                cbEstType.Items.Add(type[x]);
            }
        }
Esempio n. 10
0
        public void retrieveFilter()
        {
            ArrayList estType = new ArrayList();

            estType = ApiClass.get_est_type("all", "");
            cbCategory.Items.Add("");
            for (int x = 0; x < estType.Count; x++)
            {
                cbCategory.Items.Add(estType[x]);
            }
        }
 private void cbCurrentCategory_SelectedIndexChanged(object sender, EventArgs e)
 {
     ApiClass.editCategory(ForLoginEstVO.getEstUserID(), cbCurrentCategory.Text);
     if (forEditCategory.forEditCategory.getStatus() == 1)
     {
         cbStatus.Text = "ACTIVE";
     }
     else
     {
         cbStatus.Text = "INACTIVE";
     }
     txtCatName.Text = cbCurrentCategory.Text;
 }
 private void cbEstName_SelectedIndexChanged(object sender, EventArgs e)
 {
     txtCurrentEstName.Text = cbEstName.Text;
     ApiClass.get_est_type("specific", txtCurrentEstName.Text);
     if (forEstablishmentType.ForEstablishmentTypeVO.getStatus() == 1)
     {
         cbStatus.Text = "ACTIVE";
     }
     else
     {
         cbStatus.Text = "INACTIVE";
     }
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            int status = 0;

            if (cbStatus.Text == "ACTIVE")
            {
                status = 1;
            }
            if (ApiClass.submit_edited_est_type(txtCurrentEstName.Text, status, forEstablishmentType.ForEstablishmentTypeVO.getEstTypeID()))
            {
                MessageBox.Show("Success", "Edit Establishment Type", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void fillCategory()
        {
            cbCategory.Items.Clear();
            cbCategory.Items.Add("");
            ArrayList category = new ArrayList();

            category = ApiClass.getCategory(ForLoginEstVO.getEstUserID(), "all_active");
            category.Sort();
            for (int x = 0; x < category.Count; x++)
            {
                cbCategory.Items.Add(category[x]);
            }
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (txtItemName.Text == forEditProduct.forEditProductVO.getItemName() &&
         txtPrice.Text == forEditProduct.forEditProductVO.getPrice() &&
         status == forEditProduct.forEditProductVO.getStatus() &&
         oldPath == forEditProduct.forEditProductVO.getPath() &&
         cbCategory.Text == forEditProduct.forEditProductVO.getCategory())
     {
         MessageBox.Show("Nothing to Edit", "Edit Product", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else if (txtItemName.Text != forEditProduct.forEditProductVO.getItemName() ||
              txtPrice.Text != forEditProduct.forEditProductVO.getPrice() ||
              status != forEditProduct.forEditProductVO.getStatus() ||
              oldPath != forEditProduct.forEditProductVO.getPath() ||
              cbCategory.Text != forEditProduct.forEditProductVO.getCategory())
     {
         if (ApiClass.submit_edited_product(forEditProduct.forEditProductVO.getItemId(),
                                            ForEstablishmentLogin.ForLoginEstVO.getEstUserID()
                                            , cbCategory.Text, status,
                                            oldPath, txtItemName.Text,
                                            txtPrice.Text,
                                            upload))
         {
             MessageBox.Show("Edit Success", "Edit Product", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("Edit Fail", "Edit Product", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else if (txtItemName.Text == forEditProduct.forEditProductVO.getItemName() ||
              txtPrice.Text != forEditProduct.forEditProductVO.getPrice() ||
              status != forEditProduct.forEditProductVO.getStatus() ||
              oldPath != forEditProduct.forEditProductVO.getPath() ||
              cbCategory.Text != forEditProduct.forEditProductVO.getCategory())
     {
         if (ApiClass.submit_edited_product(forEditProduct.forEditProductVO.getItemId(),
                                            ForEstablishmentLogin.ForLoginEstVO.getEstID()
                                            , cbCategory.Text, status,
                                            oldPath, forEditProduct.forEditProductVO.getItemName(),
                                            txtPrice.Text,
                                            upload))
         {
             MessageBox.Show("Edit Success", "Edit Product", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("Edit Fail", "Edit Product", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
 public void retrieveData(string key, string filter)
 {
     data              = ApiClass.get_all_est_user(key, filter);
     txtEstName.Text   = data[0, 2];
     txtAddress.Text   = data[0, 11];
     txtLatitude.Text  = data[0, 4];
     txtLongitude.Text = data[0, 5];
     cbEmotion.Text    = data[0, 6];
     cbAge.Text        = data[0, 7];
     cbEstType.Text    = data[0, 3];
     pbFrontStore.Load(data[0, 8]);
     txtUserName.Text = data[0, 1];
     oldPath          = data[0, 8];
 }
Esempio n. 17
0
 private void retrieveData()
 {
     string[,] data = ApiClass.getProductOfEstablishment(ForEstablishmentLogin.ForLoginEstVO.getEstUserID().ToString());
     lvitemList.Items.Clear();
     for (int x = 0; x < data.Length / 5; x++)
     {
         int          i  = 0;
         ListViewItem lv = new ListViewItem(data[x, i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lvitemList.Items.Add(lv);
     }
 }
Esempio n. 18
0
 private void btnTestApi_Click(object sender, EventArgs e)
 {
     if (ApiClass.establisment_login(txtUsername.Text, txtPassword.Text) || txtUsername.Text == "SUPERADMIN" && txtPassword.Text == "SUPERADMIN123")
     {
         ForEstablishmentLogin.ForLoginEstVO.setUser(txtUsername.Text);
         frmMain main = new frmMain();
         main.Text = "Eatery Finder - " + ApiClass.AppVersion;
         main.Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("Access Denied");
     }
 }
 public void retrieveData(string est_filter, string user_filter)
 {
     string[,] data = ApiClass.getAllComment(est_filter, user_filter);
     lvCommentList.Items.Clear();
     for (int x = 0; x < data.Length / 7; x++)
     {
         int          i  = 0;
         ListViewItem lv = new ListViewItem(data[x, i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lvCommentList.Items.Add(lv);
     }
 }
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtConfirmPass.Text == "" || txtCurrentPass.Text == "" || txtNewPass.Text == "")
     {
         MessageBox.Show("Please Complete Information Needed", "Change Password", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else if (txtNewPass.Text != txtConfirmPass.Text)
     {
         MessageBox.Show("New Password not Match with Confirm Password", "Change Password", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         if (ApiClass.changePass(txtCurrentPass.Text, txtNewPass.Text, ForEstablishmentLogin.ForLoginEstVO.getEstUserID().ToString()))
         {
             MessageBox.Show("Password Changed!", "Change Password", MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.Close();
         }
     }
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            int  status = 0;
            bool exist  = false;

            if (cbStatus.Text == "ACTIVE")
            {
                status = 1;
            }
            if (cbCurrentCategory.Text.Equals(txtCatName.Text) && status == forEditCategory.forEditCategory.getStatus())
            {
                MessageBox.Show("Nothing to Edit", "Edit Category", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                for (int x = 0; x < category.Count; x++)
                {
                    if (txtCatName.Text.Equals(category[x]))
                    {
                        exist = true;
                    }
                }
                if (exist && status == forEditCategory.forEditCategory.getStatus())
                {
                    MessageBox.Show("Category name Already Exist", "Edit Category", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    if (ApiClass.submit_edited_category(forEditCategory.forEditCategory.getCatId(), ForLoginEstVO.getEstID(), txtCatName.Text, status))
                    {
                        MessageBox.Show("Edit Success", "Edit Category", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        getMenuCategory();
                    }
                    else
                    {
                        MessageBox.Show("Fail to Edit", "Edit Category", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
        }
Esempio n. 22
0
 public void retrieveData(string key, string filter)
 {
     string[,] data = ApiClass.get_all_est_user(key, filter);
     lvEst.Items.Clear();
     for (int x = 0; x < data.Length / 12; x++)
     {
         int          i  = 0;
         ListViewItem lv = new ListViewItem(data[x, i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lv.SubItems.Add(data[x, ++i]);
         lvEst.Items.Add(lv);
     }
 }
        private void frmEditProduct_Load(object sender, EventArgs e)
        {
            cbCategory.Enabled = false;
            txtPrice.Enabled   = false;
            btnChange.Enabled  = false;
            btnSave.Enabled    = false;

            ArrayList product = new ArrayList();

            product = ApiClass.getProduct(ForEstablishmentLogin.ForLoginEstVO.getEstUserID(), "all");
            for (int x = 0; x < product.Count; x++)
            {
                cbItemName.Items.Add(product[x]);
            }
            ArrayList category = new ArrayList();

            category = ApiClass.getCategory(ForEstablishmentLogin.ForLoginEstVO.getEstUserID(), "all");
            for (int x = 0; x < category.Count; x++)
            {
                cbCategory.Items.Add(category[x]);
            }
        }
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (isPassValidation())
     {
         DialogResult dialogResult = MessageBox.Show("Are you sure you want to apply changes?", "Establishment Edit", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dialogResult == DialogResult.Yes)
         {
             string path = "";
             if (oldPath != data[0, 8])
             {
                 path = oldPath;
             }
             if (ApiClass.submit_edit_est_setting(ForEstablishmentLogin.ForLoginEstVO.getEstID().ToString(), txtEstName.Text, txtAddress.Text, txtLatitude.Text, txtLongitude.Text, cbEmotion.Text, cbAge.Text, cbEstType.Text, path))
             {
                 MessageBox.Show("Changes Applied!", "Establishment Setting", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 mainStatusStrip.tsEstName.Text = "Establishment Name : " + txtEstName.Text;
             }
             else
             {
                 MessageBox.Show("Change not Applied", "Establishment Setting", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
 }
Esempio n. 25
0
 private void getData()
 {
     string[,] data       = ApiClass.getCommentByID(GlobalVO.getCommentID());
     txtComment.Text      = data[0, 0].ToString();
     cbCommentStatus.Text = data[0, 1].ToString() == "PENDING" ? "PENDING" : data[0, 1].ToString() == "REJECTED" ?  "REJECT" : "POST";
 }
Esempio n. 26
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     ApiClass.updateCommentStatus(GlobalVO.getCommentID(), cbCommentStatus.Text == "POST" ? "pass" : cbCommentStatus.Text == "REJECT" ? "reject" : "pending");
     reOpenCommentListForm();
 }
Esempio n. 27
0
 private void cbEstType_SelectedIndexChanged(object sender, EventArgs e)
 {
     ApiClass.get_est_type("specific", cbEstType.Text);
 }