public ActionResult Edit([Bind(Include = "CustomerId,CustomerName,CustomerAddress,UserName,CompanyName,Status,CreatedBy,CustomerEmail")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "ProjectStatusId,ProjectStatusName")] ProjectStatus projectStatus)
 {
     if (ModelState.IsValid)
     {
         db.Entry(projectStatus).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(projectStatus));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "ActivityStatusId,ActivityStatusName,UserName")] ActivityStatus activityStatus)
 {
     if (ModelState.IsValid)
     {
         db.Entry(activityStatus).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(activityStatus));
 }
示例#4
0
 public ActionResult Edit([Bind(Include = "ActivityId,CustomerId,ActivityName,ActivityDescription")] Activity activity)
 {
     if (ModelState.IsValid)
     {
         activity.UserName        = Convert.ToString(Session["Username"]);
         db.Entry(activity).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CustomerId = new SelectList(db.Customer, "CustomerId", "CustomerName", activity.CustomerId);
     return(View(activity));
 }
 public ActionResult Edit(WorkFlowModel workFlowModel)
 {
     if (ModelState.IsValid)
     {
         var workFlow = AutoMapper.Mapper.Map <WorkFlow>(workFlowModel);
         db.Entry(workFlow).State = EntityState.Modified;
         workFlow.UserName        = Convert.ToString(Session["Username"]);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CustomerID = new SelectList(db.Customer, "CustomerId", "CustomerName", workFlowModel.CustomerID);
     return(View(workFlowModel));
 }
示例#6
0
 public ActionResult Edit(WorkflowActivityStreamModel workflowActivityStreamModel)
 {
     if (ModelState.IsValid)
     {
         var workflowActivityStream = AutoMapper.Mapper.Map <WorkflowActivityStream>(workflowActivityStreamModel);
         workflowActivityStream.UserName        = Convert.ToString(Session["Username"]);
         db.Entry(workflowActivityStream).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ActivityID = new SelectList(db.Activity, "ActivityId", "ActivityName", workflowActivityStreamModel.ActivityID);
     ViewBag.WorkflowID = new SelectList(db.WorkFlow, "WorkflowID", "WorkflowName", workflowActivityStreamModel.WorkflowID);
     return(View(workflowActivityStreamModel));
 }
示例#7
0
 public ActionResult Edit(ProjectModel projectModel)
 {
     if (ModelState.IsValid)
     {
         var Project = AutoMapper.Mapper.Map <Project>(projectModel);
         Project.UserName        = Convert.ToString(Session["Username"]);
         db.Entry(Project).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProjectStatusId    = new SelectList(db.ProjectStatus, "ProjectStatusId", "ProjectStatusName", projectModel.ProjectStatusId);
     ViewBag.WorkflowActivityID = new SelectList(db.WorkFlow, "WorkflowID", "WorkflowName", projectModel.WorkflowActivityID);
     return(View(projectModel));
 }
示例#8
0
 public ActionResult Edit(ProjectActivityModel projectActivity)
 {
     if (ModelState.IsValid)
     {
         var project = AutoMapper.Mapper.Map <ProjectActivity>(projectActivity);
         db.Entry(project).State = EntityState.Modified;
         project.UserName        = Convert.ToString(Session["Username"]);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ActivityId       = new SelectList(db.Activity, "ActivityId", "ActivityName", projectActivity.ActivityId);
     ViewBag.ActivityStatusId = new SelectList(db.ActivityStatus, "ActivityStatusId", "ActivityStatusName", projectActivity.ActivityStatusId);
     ViewBag.ProjectId        = new SelectList(db.Project, "ProjectId", "ProjectName", projectActivity.ProjectId);
     return(View(projectActivity));
 }
示例#9
0
 public virtual void Update(T entity)
 {
     dbSet.Attach(entity);
     dataContext.Entry(entity).State = EntityState.Modified;
 }