Ejemplo n.º 1
0
        public ActionResult Delete(backend backendObj)
        {
            tabledbEntities entities = new tabledbEntities();

            entities.Entry(backendObj).State = EntityState.Deleted;
            entities.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public ActionResult delete(country countryObj)
        {
            tabledbEntities entities = new tabledbEntities();

            entities.Entry(countryObj).State = System.Data.Entity.EntityState.Deleted;
            entities.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        public ActionResult Edit(frontend frontendObj)
        {
            tabledbEntities entities = new tabledbEntities();

            entities.Entry(frontendObj).State = System.Data.Entity.EntityState.Modified;
            entities.SaveChanges();
            return(RedirectToAction("index"));
        }
Ejemplo n.º 4
0
        public ActionResult Create(video videoss, HttpPostedFileBase uploadfile)
        {
            tabledbEntities entities = new tabledbEntities();

            if (uploadfile != null)
            {
                string file = Guid.NewGuid().ToString().Substring(0, 6) + uploadfile.FileName;
                uploadfile.SaveAs(Server.MapPath("~/UploadedImages/") + file);
                videoss.uploadfile = file;
            }
            videoss.userid = Convert.ToInt32(Session["userid"]);

            entities.Entry(videoss).State = System.Data.Entity.EntityState.Added;
            entities.SaveChanges();
            return(RedirectToAction("Create"));
        }
Ejemplo n.º 5
0
        public ActionResult Create(Project project, HttpPostedFileBase projectFile)
        {
            tabledbEntities entities = new tabledbEntities();

            if (projectFile != null)
            {
                string file = Guid.NewGuid().ToString().Substring(0, 6) + projectFile.FileName;
                projectFile.SaveAs(Server.MapPath("~/UploadedImages/") + file);
                project.Projectfile = file;
            }

            project.UserId = Convert.ToInt32(Session["userid"]);

            entities.Entry(project).State = System.Data.Entity.EntityState.Added;
            entities.SaveChanges();
            return(RedirectToAction("Create"));
        }