Пример #1
0
        public ActionResult Create([Bind(Include = "Id,firstname,address,email,phone,S_S_N,role,password")] member member)
        {
            if (ModelState.IsValid)
            {
                db.members.Add(member);
                db.SaveChanges();
                return(RedirectToAction("Login", "Account"));
            }

            return(View(member));
        }
Пример #2
0
        public ActionResult Create([Bind(Include = "Id,catname,description")] category category)
        {
            if (ModelState.IsValid)
            {
                db.categories.Add(category);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(category));
        }
Пример #3
0
        public ActionResult Create([Bind(Include = "Id,starttime,endtime,memberId,book_Id")] lending lending)
        {
            if (ModelState.IsValid)
            {
                db.lendings.Add(lending);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.book_Id  = new SelectList(db.books, "Id", "isbn", lending.book_Id);
            ViewBag.memberId = new SelectList(db.members, "Id", "firstname", lending.memberId);
            return(View(lending));
        }
Пример #4
0
        public ActionResult Create(book book)
        {
            if (ModelState.IsValid)
            {
                db.books.Add(book);
                db.SaveChanges();
                //      book.file.SaveAs(Server.MapPath("~/IMG/") + book.Id + ".jpj");
                return(RedirectToAction("Index"));
            }

            ViewBag.category_Id = new SelectList(db.categories, "Id", "catname", book.category_Id);
            return(View(book));
        }
        public ActionResult Create([Bind(Include = "Id,Status,Description,IsDeleted,InsAt,InsBy,UpdAt,UpdBy")] TaskStatu taskStatu)
        {
            if (ModelState.IsValid)
            {
                taskStatu.Id = Guid.NewGuid();
                db.TaskStatus.Add(taskStatu);
                InsertAuditFields(taskStatu);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(taskStatu));
        }
        public ActionResult Create([Bind(Include = "Id,FirstName,LastName,ContactNo,Email,Skills,IsDeleted,InsAt,InsBy,UpdAt,UpdBy")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                employee.Id = Guid.NewGuid();
                db.Employees.Add(employee);
                InsertAuditFields(employee);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(employee));
        }
        public ActionResult Create([Bind(Include = "Id,Name,StartDate,EndDate,ClientName,IsDeleted,InsAt,InsBy,UpdAt,UpdBy")] Project project)
        {
            if (ModelState.IsValid)
            {
                project.Id = Guid.NewGuid();
                db.Projects.Add(project);
                InsertAuditFields(project);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(project));
        }
Пример #8
0
        public ActionResult Create([Bind(Include = "Id,Story,Projectid,IsDeleted,InsAt,InsBy,UpdAt,UpdBy")] UserStory userStory)
        {
            if (ModelState.IsValid)
            {
                userStory.Id = Guid.NewGuid();
                db.UserStories.Add(userStory);
                InsertAuditFields(userStory);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Projectid = new SelectList(db.Projects, "Id", "Name", userStory.Projectid);
            return(View(userStory));
        }
        public ActionResult Create([Bind(Include = "Id,FirstName,LastName,ProjectTaskid,Comments,IsDeleted,InsAt,InsBy,UpdAt,UpdBy")] ManagerComment managerComment)
        {
            if (ModelState.IsValid)
            {
                managerComment.Id = Guid.NewGuid();
                db.ManagerComments.Add(managerComment);
                InsertAuditFields(managerComment);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ProjectTaskid = new SelectList(db.ProjectTasks, "Id", "InsBy", managerComment.ProjectTaskid);
            return(View(managerComment));
        }
        public ActionResult Create([Bind(Include = "Id,Employeeid,TaskStartDate,TaskEndDate,TaskStatusid,UserStoryid,IsDeleted,InsAt,InsBy,UpdAt,UpdBy")] ProjectTask projectTask)
        {
            if (ModelState.IsValid)
            {
                projectTask.Id = Guid.NewGuid();
                db.ProjectTasks.Add(projectTask);
                InsertAuditFields(projectTask);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Employeeid   = new SelectList(db.Employees, "Id", "FirstName", projectTask.Employeeid);
            ViewBag.TaskStatusid = new SelectList(db.TaskStatus, "Id", "Status", projectTask.TaskStatusid);
            ViewBag.UserStoryid  = new SelectList(db.UserStories, "Id", "Story", projectTask.UserStoryid);
            return(View(projectTask));
        }