protected void Button2_Click(object sender, EventArgs e) { string username = Username1.Value; string password = Password1.Value; bool CLog = cLog.Checked; bool VLog = vLog.Checked; if (CLog == true && cLog.Value.Equals("customer")) { tbl_CustomerLogin _isLogin = obj.LoginCustomer(username, password); if (_isLogin != null) { Session["UserObj"] = _isLogin; if (CRealm.Checked) { Session["UserType"] = "Customer"; } Response.Redirect("CustomerHome.aspx"); // lbl_Message1.Text = _isLogin.CustomerID; //"Login Successfully!!! :)"; lbl_Message1.ForeColor = System.Drawing.Color.Green; } else { lbl_Message1.Text = "Login Failed. Please Verify Your Credentials!!! :)"; lbl_Message1.ForeColor = System.Drawing.Color.Red; } } else { tbl_VendorLogin _isLogin = vobj.LoginVendor(username, password); if (_isLogin != null) { Session["UserObj"] = _isLogin; if (VRealm.Checked) { Session["UserType"] = "Vendor"; } Response.Redirect("VendorHome.aspx"); lbl_Message1.Text = "Vendor Logged in !!!"; lbl_Message1.ForeColor = System.Drawing.Color.Green; } else { lbl_Message1.Text = "Login Failed. Please Verify Your Credentials!!! :)"; lbl_Message1.ForeColor = System.Drawing.Color.Red; } } }
protected void updateCount(object sender, EventArgs e) { tbl_CustomerLogin cust = new tbl_CustomerLogin(); int selectedVendorId = int.Parse(RadioButtonList1.SelectedItem.Value); Session["selectedVendor"] = selectedVendorId; cust = (tbl_CustomerLogin)Session["UserObj"]; string custname = cust.CustomerName; string custemail = cust.CustomerEmail; string custcontact = cust.ContactNumber; string ServiceType = Request.QueryString["ServiceType"]; bool _isBooked = bobj.BookingDetails(selectedVendorId, custname, custemail, custcontact); List <Inovice> incl = bobj.GenerateInvoice(selectedVendorId, custname, custcontact, ServiceType); Inovice inc = incl.First(); Session["Invoice"] = inc; Response.Redirect("../Invoice.aspx"); }
public tbl_CustomerLogin LoginCustomer(string username, string password) { tbl_CustomerLogin obj = null; try { tbl_CustomerLogin loginObj = new tbl_CustomerLogin(); loginObj.CustomerEmail = username; loginObj.Password = password; var query = from p in dbContext.tbl_CustomerLogins where p.CustomerEmail == loginObj.CustomerEmail && p.Password == loginObj.Password select p; obj = query.FirstOrDefault(); } catch (Exception ex) { } return(obj); }
public bool RegisterCustomer(string username, string password, string email, string contactNumber) { bool _isRegister = false; try { tbl_CustomerLogin loginObj = new tbl_CustomerLogin(); loginObj.CustomerName = username; loginObj.Password = password; loginObj.CustomerEmail = email; loginObj.ContactNumber = contactNumber; dbContext.tbl_CustomerLogins.InsertOnSubmit(loginObj); dbContext.SubmitChanges(); _isRegister = true; } catch (Exception ex) { } return(_isRegister); }
partial void Deletetbl_CustomerLogin(tbl_CustomerLogin instance);
partial void Updatetbl_CustomerLogin(tbl_CustomerLogin instance);
partial void Inserttbl_CustomerLogin(tbl_CustomerLogin instance);