public string reg(Register model) { Database1Entities4 db = new Database1Entities4(); db.Registers.Add(model); db.SaveChanges(); return("Successfully Registered"); }
public string addClient(Client m) { Database1Entities4 db = new Database1Entities4(); db.Clients.Add(m); db.SaveChanges(); return("Successfully Registered"); }
public string del(string EMAIL) { Database1Entities4 ent = new Database1Entities4(); Register em = ent.Registers.First(x => x.Email == EMAIL); ent.Registers.Remove(em); ent.SaveChanges(); return("Successfully Deleted"); }
public string upd(string EMAIL, string ADDRESS, string PHONE) { Database1Entities4 db2 = new Database1Entities4(); var cli = db2.Clients.First(a => a.Email == EMAIL); cli.Address = ADDRESS; cli.Phone = PHONE; db2.SaveChanges(); return("Updated Successfully"); }
public string del2(string NAME) { Database1Entities4 ent1 = new Database1Entities4(); List <Register> registers = ent1.Registers.Where(x => x.EventName == NAME).ToList(); foreach (var i in registers) { ent1.Registers.Remove(i); } ent1.SaveChanges(); return("Deleted Successfully"); }
public ActionResult update(caterer c) { Database1Entities4 d = new Database1Entities4(); int id = int.Parse(Session["cId"].ToString()); caterer y = d.caterers.First(x => x.Id == id); y.name = c.name; y.address = c.address; y.city = c.city; y.description = c.description; y.email = c.email; y.fb = c.fb; y.note = c.note; y.perhead = c.perhead; y.phone = c.phone; y.services = c.services; y.social = c.social; y.twitter = c.twitter; d.SaveChanges(); return(RedirectToAction("Index", "Home")); }