Esempio n. 1
0
        public IList <PeriodTypeViewModel> GetPeriodTypeDetails(int?daId)
        {
            try
            {
                PeriodTypeManager periodTypeManager = new PeriodTypeManager();
                var periodTypeList = periodTypeManager.GetSPeriodTypeDetails();

                PeriodTypeList = new List <PeriodTypeViewModel>();
                foreach (var item in periodTypeList)
                {
                    PeriodTypeViewModel periodTypeViewModel = new PeriodTypeViewModel();
                    periodTypeViewModel.periodTypeID   = item.PeriodTypeID;
                    periodTypeViewModel.periodTypeDesc = item.PeriodTypeDesc;


                    PeriodTypeList.Add(periodTypeViewModel);
                }
                //Trial
                return(PeriodTypeList);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
 public IList <PeriodTypeViewModel> GetPeriodTypeList(int?daId)
 {
     try
     {
         PeriodTypeViewModel periodTypeViewModel = new PeriodTypeViewModel();
         return(periodTypeViewModel.GetPeriodTypeDetails(daId));
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 3
0
        public void DeletePeriodType(PeriodTypeViewModel periodTypeViewModel)
        {
            try
            {
                tbl_PeriodType tblPeriodType = new tbl_PeriodType();
                tblPeriodType.PeriodTypeID = periodTypeViewModel.periodTypeID;
                tblPeriodType.EntityState  = DA.DomainModel.EntityState.Deleted;

                PeriodTypeManager periodTypeManager = new PeriodTypeManager();
                periodTypeManager.DeletePeriodType(tblPeriodType);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 4
0
        public void AddPeriodType(PeriodTypeViewModel periodTypeViewModel)
        {
            try
            {
                tbl_PeriodType tblPeriodType = new tbl_PeriodType();

                tblPeriodType.PeriodTypeDesc = periodTypeViewModel.periodTypeDesc;

                tblPeriodType.EntityState = DA.DomainModel.EntityState.Added;

                PeriodTypeManager periodTypeManager = new PeriodTypeManager();
                periodTypeManager.AddPeriodType(tblPeriodType);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 5
0
        public PeriodTypeViewModel FindPeriodType(int?periodTypeID)
        {
            try
            {
                PeriodTypeViewModel periodTypeViewModel = new PeriodTypeViewModel();

                PeriodTypeManager periodTypeManager = new PeriodTypeManager();
                var periodType = periodTypeManager.FindPeriodType(periodTypeID);

                periodTypeViewModel.periodTypeID   = periodType.PeriodTypeID;
                periodTypeViewModel.periodTypeDesc = periodType.PeriodTypeDesc;

                return(periodTypeViewModel);
            }
            catch (Exception)
            {
                throw;
            }
        }