예제 #1
0
        public IHttpActionResult PutWorkItem(int id, WorkItem workItem)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != workItem.WorkItemId)
            {
                return(BadRequest());
            }

            db.Entry(workItem).State = EntityState.Modified;

            try {
                db.SaveChanges();
            } catch (DbUpdateConcurrencyException) {
                if (!WorkItemExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #2
0
 public ActionResult Register(EmployeeDetails registerEmployee)
 {
     try
     {
         releaseManagementContext.RegisterEmployeesProp.Add(registerEmployee);
         releaseManagementContext.SaveChanges();
         var user = releaseManagementContext.RegisterEmployeesProp.Single(u => u.EmployeeId == registerEmployee.EmployeeId);
         if (user.Role == "Teamlead")
         {
             TeamleadDetails teamleadDetails = new TeamleadDetails(user.EmployeeId, user.EmployeeName);
             releaseManagementContext.TeamleadDetailsProp.Add(teamleadDetails);
             releaseManagementContext.SaveChanges();
         }
         if (user.Role == "Developer")
         {
             DeveloperDetails developerDetails = new DeveloperDetails(user.EmployeeId, user.EmployeeName);
             releaseManagementContext.DeveloperDetailsProp.Add(developerDetails);
             releaseManagementContext.SaveChanges();
         }
         if (user.Role == "Tester")
         {
             TesterDetails testerDetails = new TesterDetails(user.EmployeeId, user.EmployeeName);
             releaseManagementContext.TesterDetailsProp.Add(testerDetails);
             releaseManagementContext.SaveChanges();
         }
     }
     catch (Exception e)
     {
         ViewBag.Message = e.Message;
     }
     return(View());
 }
        public IHttpActionResult PutFeature(int id, Feature feature)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != feature.FeatureId)
            {
                return(BadRequest());
            }

            db.Entry(feature).State = EntityState.Modified;

            try {
                db.SaveChanges();
            } catch (DbUpdateConcurrencyException) {
                if (!FeatureExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
 public ActionResult AddProject(ProjectDetails projectDetails)
 {
     try
     {
         releaseManagementContext.AddProjectProp.Add(projectDetails);
         releaseManagementContext.SaveChanges();
     }
     catch (Exception e)
     {
         ViewBag.Message = e.Message;
     }
     return(View());
 }
예제 #5
0
 public ActionResult AddToModule(ModuleDetails addmodule)
 {
     try
     {
         db.ModuleDetailsProp.Add(addmodule);
         ViewBag.message = "Added Module Successfully!";
         db.SaveChanges();
     }
     catch (Exception e)
     {
         ViewBag.message = e.Message;
     }
     return(View());
 }
        public string Register(LoginDetails loginDetails)
        {
            try
            {
                context.LoginDetails.Add(loginDetails);
                context.SaveChanges();

                return("User Added Successfully");
            }
            catch (Exception e)
            {
                return("Failed\nException Message : " + e.Message);
            }
        }
예제 #7
0
 public ActionResult Register(LoginDetails loginDetails)
 {
     //ReleaseManagementContext db = new ReleaseManagementContext();
     try
     {
         db.EloginDetails.Add(loginDetails);
         db.SaveChanges();
         ViewBag.msg = "User created";
     }
     catch (Exception ex)
     {
         ViewBag.msg = ex.Message;
     }
     return(View());
 }
        public ActionResult reg(Login login)
        {
            dbcontext.Logins.Add(login);
            dbcontext.SaveChanges();

            return(View());
        }
예제 #9
0
        public ActionResult UpdateProjectStatus(ProjectDetails projectDetails)
        {
            string developerIdOfUPS = TempData.Peek("developerIdToUPS").ToString();
            var    projectModule    = from pro in releaseManagementContext.AddProjectProp
                                      join mod in releaseManagementContext.ModuleDetailsProp
                                      on pro.ProjectId equals
                                      mod.ProjectId
                                      into modPro
                                      from mp in modPro.DefaultIfEmpty()
                                      select new
            {
                pro.ProjectId,
                pro.ProjectName,
                pro.ProjectStatus,
                mp.DeveloperId
            };
            var devlist = projectModule.Where(a => a.DeveloperId == developerIdOfUPS && a.ProjectStatus != 1);

            ViewBag.ddl = new SelectList(devlist, "ProjectId", "ProjectId");
            try
            {
                var projectquery = releaseManagementContext.AddProjectProp.Single(m => m.ProjectId == projectDetails.ProjectId);
                ViewBag.MessageOne         = projectquery.ProjectName;
                projectquery.ProjectStatus = projectDetails.ProjectStatus;
                releaseManagementContext.SaveChanges();
            }
            catch (Exception e)
            {
                ViewBag.ErrorMessage = "Please select an option" + e.Message;
            }
            return(View());
        }
예제 #10
0
        public ActionResult Register(EmployeeDetails employee)
        {
            if (employee != null)
            {
                try
                {
                    db.EmployeeDetails.Add(employee);
                    db.SaveChanges();
                    ViewBag.Msg = "User Registered Successfully";
                }
                catch (Exception ex)
                {
                    ViewBag.Msg = ex.Message;
                }
            }

            return(View());
        }
예제 #11
0
 public ActionResult Register(LoginDetails loginDetails)
 {
     try
     {
         db.loginDetails.Add(loginDetails);
         db.SaveChanges();
         ViewBag.Message = "User created";
     }
     catch (Exception ex)
     {
         ViewBag.Message = ex.Message;
     }
     return(View());
 }
예제 #12
0
 public ActionResult RaiseBug(BugsDetails bugsDetails)
 {
     releaseManagementContext.BugsDetailsProp.Add(bugsDetails);
     releaseManagementContext.SaveChanges();
     return(View());
 }
예제 #13
0
        // PUT: api/Releases/5
        public IHttpActionResult PutRelease(int id, Release releaseModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != releaseModel.ReleaseId)
            {
                return(BadRequest());
            }
            Release entity = db.Releases
                             .Include(p => p.ReleasePlatforms)
                             .Include(p => p.Features)
                             .Include(p => p.WorkItems)
                             .First(p => p.ReleaseId == id);

            entity.ApplicationVersion = releaseModel.ApplicationVersion;
            entity.ClientId           = releaseModel.ClientId;
            entity.StatusCode         = releaseModel.StatusCode;
            entity.ClientApproverName = releaseModel.ClientApproverName;
            entity.Notes        = releaseModel.Notes;
            entity.QaStartDate  = releaseModel.QaStartDate;
            entity.QaEndDate    = releaseModel.QaEndDate;
            entity.UatStartDate = releaseModel.UatStartDate;
            entity.UatEndDate   = releaseModel.UatEndDate;
            entity.ReleaseDate  = releaseModel.ReleaseDate;

            //


            var toDelete = entity.ReleasePlatforms.Where(e => releaseModel.ReleasePlatforms.Count(m => m.PlatformCode == e.PlatformCode) == 0).ToList();

            if (toDelete.Any())
            {
                toDelete.ForEach(d => db.ReleasePlatforms.Remove(d));
            }


            releaseModel.ReleasePlatforms.ToList().ForEach(model => {
                var existingEntity = entity.ReleasePlatforms.SingleOrDefault(e => e.PlatformCode == model.PlatformCode);
                if (existingEntity != null)
                {
                    existingEntity.AvailableInStoreDate     = model.AvailableInStoreDate;
                    existingEntity.SubmittedForApprovalDate = model.SubmittedForApprovalDate;
                    //db.ReleasePlatforms.Update(existingEntity);
                }
                else     //add
                {
                    var newPlatform = new ReleasePlatform {
                        ReleaseId                = model.ReleaseId,
                        PlatformCode             = model.PlatformCode,
                        AvailableInStoreDate     = model.AvailableInStoreDate,
                        SubmittedForApprovalDate = model.SubmittedForApprovalDate
                    };
                    db.ReleasePlatforms.Add(newPlatform);
                }
            });

            try {
                db.SaveChanges();
            } catch (DbUpdateConcurrencyException) {
                if (!ReleaseExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }