Example #1
0
        protected void btnsubmit_Click(object sender, EventArgs e)
        {
            using (var context = new SRASEntities())
            {
                var objReg = (from r in context.registrations where r.Reg_Name == txtuname.Text & r.Reg_Password == txtpaswrd.Text select r).ToList();
                if (objReg.Count >= 1)
                {
                    Response.Redirect("userhome.aspx");
                }
                else
                {
                    lblMsg.Text = "Incorrect Username or Password";
                }
                //admin_login objadminlgn = new admin_login();
                //objadminlgn.username = txtuname.Text;
                //objadminlgn.password = txtpaswrd.Text;


                //string strSelect = "SELECT COUNT(*) FROM registration WHERE  Reg_name = @Username AND Reg_pass = @Password";



                //if (result >= 1)
                //{
                //   Server.Transfer("userhome.aspx");
                //    }
                //}
                //else
                //    lblMsg.Text = "Incorrect Username or Password";

                // }
            }
        }
Example #2
0
 protected void btnbook_Click1(object sender, EventArgs e)
 {
     using (var context = new SRASEntities())
     {
         request_book11 objhall = new request_book11();
         objhall.req_ac        = txtac.Text;
         objhall.req_capacity  = txtcap.Text;
         objhall.req_date      = txtrdate.Text;
         objhall.req_dept      = txtdep.Text;
         objhall.req_purpose   = txtrdate.Text;
         objhall.req_resource  = txthname.Text;
         objhall.req_eventdate = txtdate.Text;
         objhall.req_eventtime = txttime.Text;
         objhall.req_status    = txtstatus.Text;
         context.request_book11.Add(objhall);
         context.SaveChanges();
     }
 }
Example #3
0
        protected void btnsubmit_Click(object sender, EventArgs e)
        {
            using (var context = new SRASEntities())
            {
                registration objregister = new registration();
                objregister.Reg_Name        = txtname.Text;
                objregister.Reg_Department  = txtdept.Text;
                objregister.Reg_Designation = txtdesig.Text;
                objregister.Reg_Email       = txtemail.Text;
                objregister.Reg_Contact     = txtcontact.Text;
                objregister.Reg_Password    = txtpass.Text;
                objregister.Reg_Confirm     = txtcpass.Text;
                context.registrations.Add(objregister);
                context.SaveChanges();

                Server.Transfer("home.aspx");
            }
        }