예제 #1
0
 public BackLogViewModel(BackLog item)
 {
     Id          = item.Id;
     Label       = item.Label;
     Status      = item.Status;
     CreatedDate = item.CreatedDate;
 }
예제 #2
0
        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));
        }
예제 #3
0
        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"));
            }
        }
예제 #4
0
        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);
        }
예제 #6
0
        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;
            }
        }
예제 #7
0
파일: Story.cs 프로젝트: frolya/Lesson13
        public int GetTotalEstimation()
        {
            int sum = 0;

            BackLog.ForEach(task => sum += task.GetActualEstimate());
            return(sum);
        }
예제 #8
0
        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);
        }
예제 #11
0
        public ActionResult DeleteConfirmed(int id)
        {
            BackLog backLog = db.BackLogs.Find(id);

            db.BackLogs.Remove(backLog);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #12
0
        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"));
            }
        }
예제 #13
0
        public ActionResult UpdateState(int id, BackLog.State state)
        {
            BackLog backLog = db.BackLogs.Find(id);

            backLog.States = state;
            db.SaveChanges();
            Index();
            return(View("Index"));
        }
예제 #14
0
        public IHttpActionResult GetBackLog(int id)
        {
            BackLog backLog = db.BackLogs.Find(id);

            if (backLog == null)
            {
                return(NotFound());
            }

            return(Ok(backLog));
        }
예제 #15
0
 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));
 }
예제 #16
0
        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));
        }
예제 #17
0
        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));
        }
예제 #18
0
        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));
        }
예제 #19
0
        // 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));
        }
예제 #20
0
        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"));
        }
예제 #21
0
 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
     });
 }
예제 #23
0
 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();
 }
예제 #24
0
        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());
        }
예제 #26
0
        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)
 {
 }
예제 #28
0
        private bool TryCreateNewCardFor(Player player)
        {
            var card = BackLog.GenerateNewCardForPlayer(player);

            return(Dev.AddCard(card));
        }