コード例 #1
0
        public ActionResult Create([Bind(Include = "periodEndDate")] timeperiod timeperiod)
        {
            if (ModelState.IsValid)
            {
                db.timeperiods.Add(timeperiod);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(timeperiod));
        }
コード例 #2
0
        public ActionResult Create([Bind(Include = "Employee_employeeID,TimePeriod_periodEndDate,isApproved")] employeetimeperiod employeetimeperiod)
        {
            if (ModelState.IsValid)
            {
                db.employeetimeperiods.Add(employeetimeperiod);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Employee_employeeID      = new SelectList(db.employees, "employeeID", "employeeFirstName", employeetimeperiod.Employee_employeeID);
            ViewBag.TimePeriod_periodEndDate = new SelectList(db.timeperiods, "periodEndDate", "periodEndDate", employeetimeperiod.TimePeriod_periodEndDate);
            return(View(employeetimeperiod));
        }
コード例 #3
0
ファイル: FavoriteController.cs プロジェクト: mlseck/Cronus
        public ActionResult Create([Bind(Include = "favoriteID,Employee_employeeID,Activity_activityID")] favorite favorite)
        {
            if (ModelState.IsValid)
            {
                db.favorites.Add(favorite);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Activity_activityID = new SelectList(db.activities, "activityID", "activityName", favorite.Activity_activityID);
            ViewBag.Employee_employeeID = new SelectList(db.employees, "employeeID", "employeeFirstName", favorite.Employee_employeeID);
            return(View(favorite));
        }
コード例 #4
0
        public ActionResult Create([Bind(Include = "entryID,hours,date,comments,TimePeriod_employeeID,TimePeriod_periodEndDate,Activity_activityID,Project_projectID")] hoursworked hoursworked)
        {
            if (ModelState.IsValid)
            {
                db.hoursworkeds.Add(hoursworked);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Activity_activityID   = new SelectList(db.activities, "activityID", "activityName", hoursworked.Activity_activityID);
            ViewBag.TimePeriod_employeeID = new SelectList(db.employeetimeperiods, "Employee_employeeID", "Employee_employeeID", hoursworked.TimePeriod_employeeID);
            ViewBag.Project_projectID     = new SelectList(db.projects, "projectID", "projectName", hoursworked.Project_projectID);
            return(View(hoursworked));
        }
コード例 #5
0
ファイル: ApproverController.cs プロジェクト: mlseck/Cronus
        public ActionResult ApproverIndex(ApproverViewModel approverViewModel)
        {
            if (ModelState.IsValid)
            {
                //if (project.activityIds != null)
                //{
                //    project.activities = (from s in this.activityRepository.All where project.activityIds.Contains(s.activityID) select s).ToList();
                //}
                foreach (employeetimeperiod employeetp in approverViewModel.employeetimeperiods)
                {
                    db.Entry(employeetp).State = EntityState.Modified;
                }

                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(approverViewModel));
        }
コード例 #6
0
 public void Save()
 {
     context.SaveChanges();
 }