Exemplo n.º 1
0
        public ActionResult AddRequest(ConstructorRequest cq)
        {
            try
            {
                using (sithar_dbEntities1 db = new sithar_dbEntities1())
                {
                    db.ConstructorRequests.Add(cq);
                    db.SaveChanges();
                }
                // TODO: Add insert logic here

                return(RedirectToAction("getConRequest"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 2
0
        public ActionResult UpdateRequest(int id, ConstructorRequest cq)
        {
            try
            {
                using (sithar_dbEntities1 db = new sithar_dbEntities1())
                {
                    db.Entry(cq).State = System.Data.Entity.EntityState.Modified;
                    db.SaveChanges();
                }
                // TODO: Add update logic here

                return(RedirectToAction("getConRequest"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 3
0
        public ActionResult DeleteRequest(int id, FormCollection collection)
        {
            try
            {
                using (sithar_dbEntities1 db = new sithar_dbEntities1())
                {
                    ConstructorRequest cq = db.ConstructorRequests.Where(x => x.ConstructorRequestId == id).FirstOrDefault();
                    db.ConstructorRequests.Remove(cq);
                    db.SaveChanges();
                }
                // TODO: Add delete logic here

                return(RedirectToAction("getConRequest"));
            }
            catch
            {
                return(View());
            }
        }