Ejemplo n.º 1
0
        public ActionResult Create(clientTable c)
        {
            try {
                c.SSN = c.SSN.ToString();
                c.DOB = DateTime.Now;

                using (LoginDBEntities dbm = new LoginDBEntities())
                {
                    dbm.clientTables.Add(c);
                    dbm.SaveChanges();
                }
                return(RedirectToAction("Dashboard", "Home"));
            }
            catch
            {
                return(RedirectToAction("Dashboard", "Home"));
            }
        }
Ejemplo n.º 2
0
        public ActionResult Edit(int id, clientTable c)
        {
            try
            {
                using (LoginDBEntities dbm = new LoginDBEntities())
                {
                    dbm.Entry(c).State = EntityState.Modified;
                    dbm.SaveChanges();
                }



                return(RedirectToAction("Dashboard", "Home"));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Dashboard", "Home"));
            }
        }
Ejemplo n.º 3
0
        public ActionResult Delete(int id, FormCollection colection)
        {
            try
            {
                using (LoginDBEntities dbm = new LoginDBEntities())
                {
                    clientTable c = dbm.clientTables.Where(x => x.clientID == id).FirstOrDefault();
                    dbm.clientTables.Remove(c);
                    dbm.SaveChanges();
                }



                return(RedirectToAction("Dashboard", "Home"));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Dashboard", "Home"));
            }
        }