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"); } }
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"); } } }
public void showPending() { localhost.Service1 server = new localhost.Service1(); BindingSource bs = new BindingSource(); bs.DataSource = server.getLogPendingPosts(); dataGridView1.DataSource = bs; }
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; }
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(); }
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; }
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(); }
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; }
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(); }
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; }
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"); }
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"); } }
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(); } }
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"); } }
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 = ""; }
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; }
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"; } }
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"); } }
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"); } }
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"); } } }
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 = ""; } }
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 = ""; }
private void button1_Click(object sender, EventArgs e) { localhost.Service1 s = new localhost.Service1(); s.submit(); }
private void cmdadd_Click(object sender, EventArgs e) { localhost.Service1 s = new localhost.Service1(); s.Addfine(); }
private void button1_Click(object sender, EventArgs e) { localhost.Service1 s = new localhost.Service1(); s.UpdateStatus(txtregno.Text); }
private void PostDetails_Load(object sender, EventArgs e) { localhost.Service1 server = new localhost.Service1(); }
private void cmdblock_Click(object sender, EventArgs e) { localhost.Service1 s = new localhost.Service1(); s.block(); }