public string reg(Register model)
        {
            Database1Entities4 db = new Database1Entities4();

            db.Registers.Add(model);
            db.SaveChanges();
            return("Successfully Registered");
        }
예제 #2
0
        public ActionResult updateCaterer()
        {
            Database1Entities4 d = new Database1Entities4();
            int  i = int.Parse(Session["uId"].ToString());
            user u = d.users.First(x => x.Id == i);

            return(View(u.caterers.ToList()));
        }
예제 #3
0
        public string addClient(Client m)
        {
            Database1Entities4 db = new Database1Entities4();

            db.Clients.Add(m);
            db.SaveChanges();
            return("Successfully Registered");
        }
예제 #4
0
        public ActionResult ViewEventData()
        {
            Database1Entities4 db = new Database1Entities4();
            var emp = from e in db.Registers
                      orderby e.Id
                      select e;

            return(View(emp));
        }
예제 #5
0
        // GET: Employee
        public ActionResult Index()
        {
            Database1Entities4 db = new Database1Entities4();
            var emp = from e in db.Clients
                      orderby e.Email
                      select e;

            return(View(emp));
        }
예제 #6
0
        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");
        }
예제 #8
0
        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 view(string eventName, string date)
        {
            Database1Entities4 db = new Database1Entities4();

            if (eventName != "")
            {
                s = db.Events.Where(x => x.EventName == eventName).ToList();
            }
            else if (date != "")
            {
                s = db.Events.Where(x => x.Date == date).ToList();
            }
            var temp = from x in s
                       select x;

            return(View(temp));
        }
예제 #10
0
        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"));
        }
예제 #11
0
        public ActionResult index()
        {
            Database1Entities4 d = new Database1Entities4();

            return(View(d.contacts.ToList()));
        }