public BackLogViewModel(BackLog item) { Id = item.Id; Label = item.Label; Status = item.Status; CreatedDate = item.CreatedDate; }
public IHttpActionResult PutBackLog(int id, BackLog backLog) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != backLog.BackLogId) { return(BadRequest()); } db.Entry(backLog).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!BackLogExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public HttpResponseMessage ExecutedHeader(IdModelBacklog id) { BackLog guia = new BackLog(); try { if (id != null) { guia = db.BackLog.Where(x => x.IdBackLog == id.IdBackLog).FirstOrDefault(); guia.Ejecutada = true; db.SaveChanges(); return(new HttpResponseMessage(System.Net.HttpStatusCode.OK) { Content = null }); } else { return new HttpResponseMessage(System.Net.HttpStatusCode.NoContent) { Content = null } }; } catch (Exception ex) { return(Request.CreateResponse <string>(HttpStatusCode.InternalServerError, ex.Message + Environment.NewLine + "BackLog")); } }
public async Task <HttpResponseMessage> DetailAsync(IdModelBacklog Id) { BackLog guia = new BackLog(); try { if (Id != null) { guia = await db.BackLog.FindAsync(Id.IdBackLog).ConfigureAwait(false); } if (guia != null) { return new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(JsonConvert.SerializeObject(guia), System.Text.Encoding.UTF8, "application/json") } } ; else { return new HttpResponseMessage(System.Net.HttpStatusCode.NoContent) { Content = null } }; } catch (Exception ex) { return(Request.CreateResponse <string>(HttpStatusCode.InternalServerError, ex.Message + Environment.NewLine + "BackLog")); } }
public void CreateBackLogReturnsBackLog() { BacklogManage backLogManager = new BacklogManage(new TestBackLogAppContext()); BackLog backlog = backLogManager.CreateBackLog(); Assert.IsNotNull(backlog); }
public void Send(Colleague sender, string message) { switch (sender) { case BackLogColleague _: Planing.Notify(message); break; case PlaningColleague _: Work.Notify(message); break; case WorkColleague _: Demo.Notify(message); break; case DemoColleague _: Retro.Notify(message); break; case RetroColleague _: BackLog.Notify(message); break; default: throw new System.NotImplementedException(); //break; } }
public int GetTotalEstimation() { int sum = 0; BackLog.ForEach(task => sum += task.GetActualEstimate()); return(sum); }
public HttpResponseMessage EditHeader(BackLogModel guiam) { BackLog backLog = new BackLog(); try { if (guiam != null) { backLog = db.BackLog.Where(x => x.IdBackLog == guiam.IdBackLog).FirstOrDefault(); backLog.IdUnidad = guiam.IdUnidad; backLog.Fecha = guiam.Fecha; backLog.Actividad = guiam.Actividad; backLog.Tiempo = guiam.Tiempo; backLog.Ejecutada = guiam.Ejecutada; db.SaveChanges(); return(new HttpResponseMessage(System.Net.HttpStatusCode.OK) { Content = null }); } else { return new HttpResponseMessage(System.Net.HttpStatusCode.NoContent) { Content = null } }; } catch (Exception ex) { return(Request.CreateResponse <string>(HttpStatusCode.InternalServerError, ex.Message + Environment.NewLine + "BackLog")); } }
public BackLog CreateBackLog() { BackLog backlog = new BackLog(); _context.BackLogs.Add(backlog); _context.SaveChanges(); return(backlog); }
public void CreateBackLogAddsBackLog() { var backlogs = new TestBackLogAppContext(); BacklogManage backLogManager = new BacklogManage(backlogs); BackLog backlog = backLogManager.CreateBackLog(); Assert.AreEqual(backlogs.BackLogs.Local.Count, 1); }
public ActionResult DeleteConfirmed(int id) { BackLog backLog = db.BackLogs.Find(id); db.BackLogs.Remove(backLog); db.SaveChanges(); return(RedirectToAction("Index")); }
public HttpResponseMessage DeleteHeader(IdModelBacklog id) { BackLog guia = new BackLog(); List <BackLogMaterial> backLogMaterial = new List <BackLogMaterial>(); List <BackLogPuesto> backLogPuesto = new List <BackLogPuesto>(); List <BackLogRefaccion> backLogRefaccion = new List <BackLogRefaccion>(); try { if (id != null) { backLogMaterial = db.BackLogMaterial.Where(x => x.IdBackLog == id.IdBackLog).ToList(); if (backLogMaterial != null) { foreach (BackLogMaterial logMaterial in backLogMaterial) { db.BackLogMaterial.Remove(logMaterial); } } backLogPuesto = db.BackLogPuesto.Where(x => x.IdBackLog == id.IdBackLog).ToList(); if (backLogPuesto != null) { foreach (BackLogPuesto logMaterial in backLogPuesto) { db.BackLogPuesto.Remove(logMaterial); } } backLogRefaccion = db.BackLogRefaccion.Where(x => x.IdBackLog == id.IdBackLog).ToList(); if (backLogRefaccion != null) { foreach (BackLogRefaccion logMaterial in backLogRefaccion) { db.BackLogRefaccion.Remove(logMaterial); } } guia = db.BackLog.Where(x => x.IdBackLog == id.IdBackLog).FirstOrDefault(); db.BackLog.Remove(guia); db.SaveChanges(); return(new HttpResponseMessage(System.Net.HttpStatusCode.OK) { Content = null }); } else { return new HttpResponseMessage(System.Net.HttpStatusCode.NoContent) { Content = null } }; } catch (Exception ex) { return(Request.CreateResponse <string>(HttpStatusCode.InternalServerError, ex.Message + Environment.NewLine + "BackLog")); } }
public ActionResult UpdateState(int id, BackLog.State state) { BackLog backLog = db.BackLogs.Find(id); backLog.States = state; db.SaveChanges(); Index(); return(View("Index")); }
public IHttpActionResult GetBackLog(int id) { BackLog backLog = db.BackLogs.Find(id); if (backLog == null) { return(NotFound()); } return(Ok(backLog)); }
public ActionResult Edit([Bind(Include = "BackLogId,Description,Priority,EstimatedTime,Responsible,States")] BackLog backLog) { if (ModelState.IsValid) { //backLog.States = BackLog.State.IsToDo; db.Entry(backLog).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(backLog)); }
public ActionResult Create([Bind(Include = "BackLogId,Description,Priority,EstimatedTime,Responsible,States")] BackLog backLog) { if (ModelState.IsValid) { backLog.States = BackLog.State.Backlog; db.BackLogs.Add(backLog); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(backLog)); }
public IHttpActionResult PostBackLog(BackLog backLog) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.BackLogs.Add(backLog); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = backLog.BackLogId }, backLog)); }
public IHttpActionResult DeleteBackLog(int id) { BackLog backLog = db.BackLogs.Find(id); if (backLog == null) { return(NotFound()); } db.BackLogs.Remove(backLog); db.SaveChanges(); return(Ok(backLog)); }
// GET: BackLogWeb/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BackLog backLog = db.BackLogs.Find(id); if (backLog == null) { return(HttpNotFound()); } return(View(backLog)); }
public ActionResult SumbitNewState(BackLog.State newState, int?id) { BackLog backLog = new BackLog(); if (ModelState.IsValid) { //backLog.States = BackLog.State.IsToDo; backLog = db.BackLogs.Find(id); backLog.States = newState; db.SaveChanges(); return(RedirectToAction("Index")); } return(View("Index")); }
public BackLogViewModel NewBackLog(BackLogViewModel item) { if (item != null) { var created = new BackLog { Id = item.Id, Label = item.Label, Status = item.Status, CreatedDate = DateTime.Now }; Db.BackLogs.Add(created); Db.SaveChanges(); } return(item); }
public AdoptRequestModel Convert(BackLog entity) { return(new AdoptRequestModel { AdoptedBy = entity.AdoptedBy, Id = entity.Id, AdoptionReason = entity.AdoptionReason, AdoptionValue = entity.AdoptionValue, BootcampAssigned = entity.BootcampAssigned, CustomerProblem = entity.CustomerProblem, IsAdopted = entity.IsAdopted, Links = entity.Links, ProblemDescription = entity.ProblemDescription, ProductOwner = entity.ProductOwner, RaisedBy = entity.RaisedBy, SolutionDescription = entity.SolutionDescription, Status = entity.Status, AdoptionEmailAddress = entity.AdoptionEmailAddress }); }
protected override void Initialize() { Game1Utility.Initialize(); Game1Utility.LoadContent(); fireballList = new Collection <MarioFireball>(); newKeyboardState = new KeyboardState(); oldKeyboardState = new KeyboardState(); MouseState = new MouseState(); DisableControl = false; continueTimer = 0; EndGameStatus = false; IsMouseVisible = false; MouseControl = false; playSound = false; FileName = "Level.xml"; GameStatus = GameState.LivesScreen; CameraPointer = new Camera(); BackLog = new BackLog(); Cheat = new CheatCodeHandler(this); base.Initialize(); }
public HttpResponseMessage CreateHeader(BackLogModel guiam) { BackLog backLog = new BackLog(); try { int idback = 0; if (guiam != null) { backLog.IdUnidad = guiam.IdUnidad; backLog.Fecha = guiam.Fecha; backLog.Actividad = guiam.Actividad; backLog.Tiempo = guiam.Tiempo; backLog.Ejecutada = false; db.BackLog.Add(backLog); db.SaveChanges(); DateTime fecha = Convert.ToDateTime(guiam.Fecha.ToShortDateString()); var guia = db.BackLog.Where(x => x.IdUnidad == x.IdUnidad && x.Actividad == guiam.Actividad && x.Fecha == fecha && x.Tiempo == guiam.Tiempo).FirstOrDefault(); idback = guia.IdBackLog; return(new HttpResponseMessage(System.Net.HttpStatusCode.OK) { Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(idback), System.Text.Encoding.UTF8, "application/json") }); } else { return new HttpResponseMessage(System.Net.HttpStatusCode.NoContent) { Content = null } }; } catch (Exception ex) { return(Request.CreateResponse <string>(HttpStatusCode.InternalServerError, ex.Message + Environment.NewLine + "BackLog")); } }
public IHttpActionResult AddMovie(int id, string userId) { Movie movieInDb = _context.Movies.Include(m => m.Genres).SingleOrDefault(m => m.MovieId == id); BackLog backlog = retreiveBacklog(userId); List <Genre> genres = new List <Genre>(); if (movieInDb == null) { return(NotFound()); } Movie movie = new Movie(); movie.ReleaseYear = movieInDb.ReleaseYear; movie.Title = movieInDb.Title; movie.RunningTime = movieInDb.RunningTime; backlog.Movies.Add(movie); _context2.SaveChanges(); // Add genre(s) to new movie by changing movieId from old movie to new movie foreach (var genre in movieInDb.Genres.ToList()) { Genre gen = new Genre() { Name = genre.Name }; genres.Add(gen); } movie.Genres = genres; _context.Movies.Remove(movieInDb); _context.SaveChanges(); _context2.SaveChanges(); return(Ok()); }
public static bool CompleteDisbursement(int dNo, decimal?pin) { LussisEntities context = new LussisEntities(); Disbursement d = context.Disbursements.Where(x => x.DisbursementNo == dNo).FirstOrDefault(); List <DisbursementDetail> dDetails = d.DisbursementDetails.ToList(); // If Pin is Valid if (d.Pin == pin) { // Update Disbursement Status d.Status = "Completed"; // Create Backlogs for (int i = 0; i < dDetails.Count; i++) { String deptCode = dDetails[i].Disbursement.DeptCode; String itemCode = dDetails[i].ItemNo; if (dDetails[i].Needed - dDetails[i].Received > 0) { BackLog backlog = context .BackLogs .Where(x => x.DeptCode.Equals(deptCode) && x.ItemNo.Equals(itemCode)) .FirstOrDefault(); if (backlog == null) { backlog = new BackLog(); backlog.DeptCode = dDetails[i].Disbursement.DeptCode; backlog.ItemNo = dDetails[i].ItemNo; backlog.BackLogQty = dDetails[i].Needed - dDetails[i].Received; context.BackLogs.Add(backlog); } else { backlog.BackLogQty += dDetails[i].Needed - dDetails[i].Received; } } } context.SaveChanges(); // Send Email Employee recipient = d.Employee; var emailDetails = dDetails.Select( dD => new { ItemNo = dD.ItemNo, ItemDescription = dD.StationeryCatalogue.Description, Needed = dD.Needed, Delivered = dD.Received }); string recipientEmail = recipient.Email; string emailSubject = EmailTemplate.GenerateCompletedDisbursementSubject(d.DisbursementNo); string emailContent = EmailTemplate.GenerateCompletedDisbursementEmail(recipient.EmpName, d.DisbursementNo, d.DisbursementDate); EmailBackend.sendEmailStep(recipientEmail, emailSubject, emailContent); return(true); } else { return(false); } }
public void MarkAsModifed(BackLog log) { }
private bool TryCreateNewCardFor(Player player) { var card = BackLog.GenerateNewCardForPlayer(player); return(Dev.AddCard(card)); }