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; } } }
public List <Inovice> GenerateInvoice(int selectedVendorId, string custname, string custcontact, string ServiceType) { bool _isinvoice = false; tbl_VendorLogin vObj = new tbl_VendorLogin(); var obj = (from r in vbContext.tbl_VendorLogins where r.VendorID == selectedVendorId select r).FirstOrDefault(); inc.VenName = obj.VendorName; inc.VenEmail = obj.VendorEmail; inc.VenContact = obj.VendorContact; inc.Basic = (int)obj.VisitingCharges; inc.CustName = custname; inc.CustContact = custcontact; inc.ServiceType = ServiceType; incl.Add(inc); _isinvoice = true; return(incl); }
public bool addExtraDetail(string profession, int maxD, int visitCharge, int id) { bool _isAdded = false; try { tbl_VendorLogin loginObj = new tbl_VendorLogin(); loginObj.VendorProfession = profession; loginObj.MaxServiceDistance = maxD; loginObj.VisitingCharges = visitCharge; loginObj.VendorID = id; var query = from ord in dbContext.tbl_VendorLogins where ord.VendorID == id select ord; // Execute the query, and change the column values // you want to change. foreach (tbl_VendorLogin ord in query) { ord.VendorProfession = loginObj.VendorProfession; ord.MaxServiceDistance = loginObj.MaxServiceDistance; ord.VisitingCharges = loginObj.VisitingCharges; // Insert any additional changes to column values. } // Submit the changes to the database. dbContext.SubmitChanges(); _isAdded = true; } catch (Exception e) { Console.WriteLine(e); // Provide for exceptions. } return(_isAdded); }
protected void Page_Load(object sender, EventArgs e) { tbl_VendorLogin vl = new tbl_VendorLogin(); vl = (tbl_VendorLogin)Session["UserObj"]; int id = vl.VendorID; List <Booking> book = bobj.showBooking(id); DataTable table = new DataTable(); table.Columns.Add("Customer Name"); table.Columns.Add("Email"); table.Columns.Add("Contact"); foreach (var obj in book) { table.Rows.Add(obj.CustName, obj.CustEmail, obj.CustContact); } DataGrid1.DataSource = table; DataGrid1.DataBind(); }
public tbl_VendorLogin LoginVendor(string username, string password) { tbl_VendorLogin obj = null; try { tbl_VendorLogin loginObj = new tbl_VendorLogin(); loginObj.VendorEmail = username; loginObj.VendorPassword = password; var query = from p in dbContext.tbl_VendorLogins where p.VendorEmail == loginObj.VendorEmail && p.VendorPassword == loginObj.VendorPassword select p; obj = query.FirstOrDefault(); } catch (Exception ex) { } return(obj); }
public bool RegisterVendor(string username, string password, string email, string contactNumber) { bool _isRegister = false; try { tbl_VendorLogin loginObj = new tbl_VendorLogin(); loginObj.VendorName = username; loginObj.VendorPassword = password; loginObj.VendorEmail = email; loginObj.VendorContact = contactNumber; // loginObj.VendorProfession= profession; // loginObj.VisitingCharges = 100; // loginObj.MaxServiceDistance = 20; dbContext.tbl_VendorLogins.InsertOnSubmit(loginObj); dbContext.SubmitChanges(); _isRegister = true; } catch (Exception ex) { } return(_isRegister); }
protected void setVendorsDetail(object sender, EventArgs e) { tbl_VendorLogin vl = new tbl_VendorLogin(); vl = (tbl_VendorLogin)Session["UserObj"]; int id = vl.VendorID; // string profession = Realm.Value; int msd = 0; String Profession = null; string latitude = lat.Value; string longitude = lon.Value; int basic = 0; bool plumbing = Plumbing.Checked; if (plumbing) { Profession = Plumbing.Value; } bool electical = Electrical.Checked; if (electical) { Profession = Electrical.Value; } bool carpentry = Carpentry.Checked; if (carpentry) { Profession = Carpentry.Value; } bool painting = Painting.Checked; if (painting) { Profession = Painting.Value; } bool interior = Interior_Design_Decorating.Checked; if (interior) { Profession = Interior_Design_Decorating.Value; } bool one = One.Checked; if (one) { msd = int.Parse(One.Value); } bool two = Two.Checked; if (two) { msd = int.Parse(Two.Value); } bool three = Three.Checked; if (three) { msd = int.Parse(Three.Value); } bool four = Four.Checked; if (four) { msd = int.Parse(Four.Value); } basic = int.Parse(Basic.Value); bool is_feed = vd.addExtraDetail(Profession, msd, basic, id); bool is_located = ld.addLocationDetails(latitude, longitude, id); Response.Redirect("VendorHome.aspx"); }
partial void Deletetbl_VendorLogin(tbl_VendorLogin instance);
partial void Updatetbl_VendorLogin(tbl_VendorLogin instance);
partial void Inserttbl_VendorLogin(tbl_VendorLogin instance);