Exemplo n.º 1
0
        private void cmdLogin_Click(object sender, EventArgs e)
        {
            bool valid;
            bool isvalid;
            bool adminvalid;
            bool adminisvalid;

            localhost.Service1 server = new localhost.Service1();
            server.Login_user(txtusername.Text, txtpassword.Text, out valid, out isvalid);
            server.isadmin(txtusername.Text, txtpassword.Text, out adminvalid, out adminisvalid);
            if (valid)
            {
                MessageBox.Show("Welcome User");
                AddPost adpost = new AddPost();
                this.Hide();
                adpost.Show();
            }
            else if (adminvalid)
            {
                MessageBox.Show("Welcome Admin");
                PendingPostsAdmin adpage = new PendingPostsAdmin();
                this.Hide();
                adpage.Show();
            }

            else
            {
                MessageBox.Show("User Not Found");
            }
        }
Exemplo n.º 2
0
        private void btnRegister_Click(object sender, EventArgs e)
        {
            localhost.Service1 server = new localhost.Service1();

            if (chkadmin.CheckState == CheckState.Unchecked)
            {
                server.registeruser(txtusername.Text, txtpassword.Text);
                if (string.IsNullOrWhiteSpace(txtusername.Text) && string.IsNullOrWhiteSpace(txtpassword.Text))
                {
                    MessageBox.Show("Empty");
                }
                else
                {
                    MessageBox.Show("Registered as User");
                }
            }
            else
            {
                server.registeradmin(txtusername.Text, txtpassword.Text);
                if (string.IsNullOrWhiteSpace(txtusername.Text) && string.IsNullOrWhiteSpace(txtpassword.Text))
                {
                    MessageBox.Show("Empty");
                }
                else
                {
                    MessageBox.Show("Registered as An Admin");
                }
            }
        }
Exemplo n.º 3
0
        public void showPending()
        {
            localhost.Service1 server = new localhost.Service1();
            BindingSource      bs     = new BindingSource();

            bs.DataSource            = server.getLogPendingPosts();
            dataGridView1.DataSource = bs;
        }
Exemplo n.º 4
0
        public void approvedPosts()
        {
            localhost.Service1 server = new localhost.Service1();
            localhost.Post     PRO    = new localhost.Post();
            BindingSource      bs     = new BindingSource();

            bs.DataSource         = server.getapprovedpost();
            dgapproved.DataSource = bs;
        }
Exemplo n.º 5
0
        private void label4_Click(object sender, EventArgs e)
        {
            int  k;
            bool l;

            localhost.Service1 s = new localhost.Service1();
            s.getattendence(textBox1.Text, textBox2.Text, out k, out l);
            label4.Text = k.ToString();
        }
Exemplo n.º 6
0
        public void showPostPend()
        {
            localhost.Service1 server = new localhost.Service1();
            localhost.Post     PRO    = new localhost.Post();
            BindingSource      bs     = new BindingSource();

            bs.DataSource             = server.getPendingpostlist();
            dgPendingAdmin.DataSource = bs;
        }
Exemplo n.º 7
0
        private void cmdapprove_Click(object sender, EventArgs e)
        {
            localhost.Service1 server        = new localhost.Service1();
            int             selectedrowindex = dgPendingAdmin.SelectedCells[0].RowIndex;
            DataGridViewRow selectedRow      = dgPendingAdmin.Rows[selectedrowindex];
            string          i = selectedRow.Cells[5].Value.ToString();

            server.approvePost(i);
            showPostPend();
        }
Exemplo n.º 8
0
        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            int  checkratingResult;
            bool checkratingResultSpecified;

            localhost.Service1 s = new localhost.Service1();
            //  s.checkrating(txtDate.Text, txtType.Text, out checkratingResult, out checkratingResultSpecified);
            //string y = checkratingResult.ToString();
            //txtRating.Text = y;
        }
Exemplo n.º 9
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            localhost.Service1 s = new localhost.Service1();
            int  k;
            bool l;

            s.claculate_bill(out k, out l);

            textBox1.Text = k.ToString();
        }
Exemplo n.º 10
0
        private void cmdShow_Click(object sender, EventArgs e)
        {
            int  checkbillbydateResult;
            bool checkbillbydateResultSpecified;

            localhost.Service1 h = new localhost.Service1();
            h.checkbillbydate(txtdate.Text, out checkbillbydateResult, out checkbillbydateResultSpecified);
            string x = checkbillbydateResult.ToString();

            txtbill.Text = x;
        }
Exemplo n.º 11
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            bool rSpecified = true;

            localhost.Service1 s = new localhost.Service1();
            int y = Int32.Parse(txtRating.Text);

            s.rate(y, rSpecified, txtDate.Text, txtType.Text);
            txtDate.Text   = "";
            txtRating.Text = "";
            txtType.Text   = "";
            MessageBox.Show("Thanks for your responce");
        }
Exemplo n.º 12
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool osfound, found;

            localhost.Service1 s = new localhost.Service1();
            s.forget_password(comboBox1.Text, textBox1.Text, textBox2.Text, out osfound, out found);
            if (osfound)
            {
                MessageBox.Show("changed");
            }
            else
            {
                MessageBox.Show("not changed");
            }
        }
Exemplo n.º 13
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            localhost.Service1 server = new localhost.Service1();
            bool postidspecified      = true;

            if (e.ColumnIndex == 0)
            {
                localhost.Post post = server.getpost(e.RowIndex, postidspecified);
                PostDetails    pd   = new PostDetails();
                pd.setTitle(post.Title);
                pd.setCategory(post.Category);
                pd.setdescription(post.Description);
                pd.Show();
            }
        }
Exemplo n.º 14
0
        private void cmdlogin_Click(object sender, EventArgs e)
        {
            bool valid;
            bool isvalid;

            localhost.Service1 server = new localhost.Service1();
            server.Login(txtusername.Text, txtpassword.Text, out valid, out isvalid);
            if (valid)
            {
                MessageBox.Show("Welcome");
            }
            else
            {
                MessageBox.Show("getout");
            }
        }
Exemplo n.º 15
0
 private void cmdaddpost_Click(object sender, EventArgs e)
 {
     localhost.Service1 server = new localhost.Service1();
     server.addpost(txtposttitle.Text, txtpostcategory.Text, txtpostdescription.Text);
     if (string.IsNullOrWhiteSpace(txtposttitle.Text) && string.IsNullOrWhiteSpace(txtpostcategory.Text) && string.IsNullOrWhiteSpace(txtpostdescription.Text))
     {
         MessageBox.Show("Empty");
     }
     else
     {
         MessageBox.Show("Posted Succesfully Now Wait For Approval");
     }
     txtposttitle.Text       = "";
     txtpostcategory.Text    = "";
     txtpostdescription.Text = "";
 }
Exemplo n.º 16
0
        private void on_off_Load(object sender, EventArgs e)
        {
            localhost.Service1 s = new localhost.Service1();
            BindingSource      d = new BindingSource();

            d.DataSource                      = s.ViewMenu();
            dataGridView1.DataSource          = d;
            dataGridView1.Columns[0].Visible  = false;
            dataGridView1.Columns[1].Visible  = false;
            dataGridView1.Columns[6].Visible  = false;
            dataGridView1.Columns[7].Visible  = false;
            dataGridView1.Columns[8].Visible  = false;
            dataGridView1.Columns[10].Visible = false;
            dataGridView1.Columns[11].Visible = false;
            dataGridView1.Columns[12].Visible = false;
        }
Exemplo n.º 17
0
        private void button1_Click(object sender, EventArgs e)
        {
            localhost.Service1 s = new localhost.Service1();

            int  checkResult;
            bool checkResultSpecified;

            s.check(txtreg_no.Text, out checkResult, out checkResultSpecified);
            if (checkResult == 1)
            {
                txtstatus.Text = "bill is paid";
            }
            else
            {
                txtstatus.Text = "bill is not paid";
            }
        }
Exemplo n.º 18
0
        private void cmdLogin_Click(object sender, EventArgs e)
        {
            localhost.Service1 s = new localhost.Service1();
            bool Adminisvalid, Adminisvalidpassed;

            s.Adminisvalid(txtusername.Text, txtpassword.Text, out Adminisvalid, out Adminisvalidpassed);

            if (Adminisvalid)
            {
                MessageBox.Show("Valid admin");
                frmaddfood l = new frmaddfood();
                this.Hide();
                l.Show();
            }
            else
            {
                MessageBox.Show("inValid admin");
            }
        }
Exemplo n.º 19
0
        private void button1_Click(object sender, EventArgs e)
        {
            localhost.Service1 s = new localhost.Service1();
            bool isvalid, isvalidpassed;

            s.isvalid(txtfname.Text, txtlname.Text, txtreg.Text, txtpassword.Text, out isvalid, out isvalidpassed);

            if (isvalid)
            {
                MessageBox.Show("Valid user");
                frmoptions j = new frmoptions();
                this.Hide();
                j.Show();
            }
            else
            {
                MessageBox.Show("inValid user");
            }
        }
Exemplo n.º 20
0
Arquivo: Form1.cs Projeto: Saad313/new
 private void cmdregister_Click(object sender, EventArgs e)
 {
     localhost.Service1 server = new localhost.Service1();
     server.register(txtusername.Text, txtpassword.Text);
     if (string.IsNullOrWhiteSpace(txtusername.Text) || string.IsNullOrWhiteSpace(txtpassword.Text))
     {
         MessageBox.Show("Empty");
     }
     else
     {
         if (chkadmin.CheckState == CheckState.Checked)
         {
             MessageBox.Show("Registered As Admin");
         }
         else
         {
             MessageBox.Show("Registered");
         }
     }
 }
Exemplo n.º 21
0
        private void cmdupdate_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtname.Text) || string.IsNullOrWhiteSpace(txtprice.Text) || string.IsNullOrWhiteSpace(txtday.Text) || string.IsNullOrWhiteSpace(txtdate.Text) || string.IsNullOrWhiteSpace(txtday.Text))
            {
                MessageBox.Show("please fill above boxes");
            }
            else
            {
                int  x               = Int32.Parse(txtprice.Text);
                bool pSpecified      = true;
                localhost.Service1 s = new localhost.Service1();
                s.Update_food(txtname.Text, x, pSpecified, txtday.Text, txtdate.Text);

                MessageBox.Show("Food has been updated");
                txtname.Text  = "";
                txtprice.Text = "";
                txtday.Text   = "";
                txtdate.Text  = "";
            }
        }
Exemplo n.º 22
0
        private void button1_Click(object sender, EventArgs e)
        {
            localhost.Service1 s = new localhost.Service1();
            bool validsregistrationout;
            bool valid;

            s.ValidRegistration(txtreg.Text, out validsregistrationout, out valid);
            if (validsregistrationout)
            {
                s.register(txtfname.Text, txtlname.Text, txtreg.Text, txtpassword.Text, txtquest.Text, txtans.Text);
                MessageBox.Show("user has been registered");
            }
            else
            {
                MessageBox.Show("This Registration Number is alredy registered");
            }
            txtfname.Text    = "";
            txtlname.Text    = "";
            txtpassword.Text = "";
            txtreg.Text      = "";
            txtans.Text      = "";
        }
Exemplo n.º 23
0
        private void button1_Click(object sender, EventArgs e)
        {
            localhost.Service1 s = new localhost.Service1();

            s.submit();
        }
Exemplo n.º 24
0
 private void cmdadd_Click(object sender, EventArgs e)
 {
     localhost.Service1 s = new localhost.Service1();
     s.Addfine();
 }
Exemplo n.º 25
0
 private void button1_Click(object sender, EventArgs e)
 {
     localhost.Service1 s = new localhost.Service1();
     s.UpdateStatus(txtregno.Text);
 }
Exemplo n.º 26
0
 private void PostDetails_Load(object sender, EventArgs e)
 {
     localhost.Service1 server = new localhost.Service1();
 }
Exemplo n.º 27
0
 private void cmdblock_Click(object sender, EventArgs e)
 {
     localhost.Service1 s = new localhost.Service1();
     s.block();
 }