예제 #1
0
 public bool DeleteApplicationPhaseComment(Op_ApplicationPhaseComment apc)
 {
     try
     {
         db.ApplicationPhaseComments.Remove(apc);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(false);
     }
 }
예제 #2
0
 public bool EditApplicationPhaseComment(Op_ApplicationPhaseComment newApc)
 {
     try
     {
         var oldData = db.ApplicationPhaseComments.Find(newApc.ApplicationId, newApc.PhaseId);
         oldData = newApc;
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(false);
     }
 }
예제 #3
0
        public string addPhase(string phaseTask, string phaseComment, int phaseId, int appId)
        {
            try
            {
                Op_ApplicationPhaseComment phComm = new Op_ApplicationPhaseComment();
                phComm.ApplicationId = appId;
                phComm.PhaseId       = phaseId;
                phComm.PhaseTask     = phaseTask;
                phComm.Comment       = phaseComment;

                _context.ApplicationPhaseComments.Add(phComm);
                _context.SaveChanges();
                return("Phase has been added");
            }
            catch (Exception)
            {
                return("Phase is already found for this application");
            }
        }