Esempio n. 1
0
        /// <summary>
        /// Edit Milestone
        /// </summary>
        /// <param name="id">Milestone Id</param>
        /// <returns>Milestone details view</returns>
        public ActionResult MilestoneEdit(int id)
        {
            MODEL.Milestone milestone = new MODEL.Milestone();

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

                if (milestoneVO == null)
                {
                    ModelState.AddModelError("", String.Format(Constants.ITEM_NOT_FOUND, Constants.MILESTONE));
                }
                else
                {
                    milestone = new MODEL.Milestone(milestoneVO);
                    milestone.MilestoneStatusList = GetMilestoneStatusList();
                    FillMilestoneBillingLines(milestone, milestone.MilestoneBillingLines);
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("", e.Message);
            }
            return(PartialView("MilestoneDetails", milestone));
        }
Esempio n. 2
0
        public ActionResult MilestoneSave(MODEL.Milestone model)
        {
            try
            {
                MilestoneService milestoneService = new MilestoneService();

                if (ModelState.IsValid)
                {
                    //Get user id
                    int?userId = Session.GetUserId();
                    //MilestoneVO milestoneVO = new MilestoneVO(model, userId);

                    MilestoneVO milestoneVO = model.Transpose(userId);

                    milestoneService.SaveMilestone(milestoneVO);
                    return(new HttpStatusCodeResult(200));
                }
                else
                {
                    throw new ApplicationException(String.Format(Constants.CANNOT_SAVE, Constants.MILESTONE));
                }
            }
            catch (ApplicationException e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the Milestone status List
        /// </summary>
        /// <returns>Milestonestatus List</returns>
        private List <MODEL.MilestoneStatus> GetMilestoneStatusList()
        {
            //MODEL.MilestoneStatus milestoneStatus = new MODEL.MilestoneStatus();
            MODEL.Milestone          milestone = new MODEL.Milestone();
            MilestoneStatusService   milestoneStatusService = new MilestoneStatusService();
            List <MilestoneStatusVO> milestoneStatusVOList  = milestoneStatusService.GetMilestoneStatusList();

            foreach (var item in milestoneStatusVOList)
            {
                milestone.MilestoneStatusList.Add(new MODEL.MilestoneStatus(item));
            }

            return(milestone.MilestoneStatusList);
        }
Esempio n. 4
0
        /// <summary>
        /// Fill billing lines to store in database
        /// </summary>
        /// <param name="milestone">The milestone object</param>
        private void FillBillingLines(Milestone milestone)
        {
            if (MilestoneBillingLineVos == null)
            {
                MilestoneBillingLineVos = new List <MilestoneBillingLineVO>();
            }

            //if (!String.IsNullOrEmpty(contractMaintenance.billingText1))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID1, LineSequance = 0, LineText = milestone.billingText1
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText2))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID2, LineSequance = 1, LineText = milestone.billingText2
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText3))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID3, LineSequance = 2, LineText = milestone.billingText3
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText4))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID4, LineSequance = 3, LineText = milestone.billingText4
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText5))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID5, LineSequance = 4, LineText = milestone.billingText5
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText6))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID6, LineSequance = 5, LineText = milestone.billingText6
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText7))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID7, LineSequance = 6, LineText = milestone.billingText7
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText8))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID8, LineSequance = 7, LineText = milestone.billingText8
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText9))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID9, LineSequance = 8, LineText = milestone.billingText9
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText10))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID10, LineSequance = 9, LineText = milestone.billingText10
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText11))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID11, LineSequance = 10, LineText = milestone.billingText11
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText12))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID12, LineSequance = 11, LineText = milestone.billingText12
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText13))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID13, LineSequance = 12, LineText = milestone.billingText13
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText14))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID14, LineSequance = 13, LineText = milestone.billingText14
            });
            //}
            //if (!String.IsNullOrEmpty(contractMaintenance.billingText15))
            //{
            MilestoneBillingLineVos.Add(new MilestoneBillingLineVO()
            {
                ID = milestone.billingTextID15, LineSequance = 14, LineText = milestone.billingText15
            });
            //}
        }