示例#1
0
        /// <summary>
        /// Get Milestone billing lines
        /// </summary>
        /// <param name="id">Milestone Id</param>
        /// <returns>Milestone billing lines view</returns>
        public ActionResult GetMilestoneBillingLines(int id)
        {
            var milestone = new Milestone();

            try
            {
                //Get milestone details
                var         milestoneService = new MilestoneService();
                MilestoneVO milestoneVO      = milestoneService.GetMilestoneById(id);

                if (milestoneVO == null)
                {
                    ModelState.AddModelError("", String.Format(Constants.ITEM_NOT_FOUND, Constants.MILESTONE));
                }
                else
                {
                    milestone = new Milestone(milestoneVO)
                    {
                        MilestoneStatusList = GetMilestoneStatusList()
                    };
                    FillMilestoneBillingLines(milestone, milestone.MilestoneBillingLines);
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("", e.Message);
            }
            return(PartialView("_BillingLines", milestone));
        }
示例#2
0
 public HttpResponseMessage GetMilestone(Guid id)
 {
     try
     {
         var milestone = _milestoneService.GetMilestoneById(id);
         if (milestone == null)
         {
             return(Request.CreateResponse(HttpStatusCode.NotFound));
         }
         return(Request.CreateResponse(HttpStatusCode.OK, milestone));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }