public async Task <IActionResult> Index()
        {
            var groupMasterList = await _groupMasterHelper.GetGroupMasterViewModelDetails();

            List <GroupMasterViewModel> lstGrpMasters = new List <GroupMasterViewModel>();

            lstGrpMasters = groupMasterList;
            return(View(lstGrpMasters));
        }
Example #2
0
        public async Task <IActionResult> SaveMainActivity(int mainActivityId = 0)
        {
            var groupMasters = await _groupMasterHelper.GetGroupMasterViewModelDetails();

            List <GroupMasterViewModel> lstGroupMaster = new List <GroupMasterViewModel>();

            if (groupMasters != null)
            {
                foreach (var item in groupMasters)
                {
                    lstGroupMaster.Add(new GroupMasterViewModel()
                    {
                        GroupId   = item.GroupId,
                        GroupName = item.GroupCode
                    });
                }
            }
            MainActivityMasterViewModel mainAcitivity = new MainActivityMasterViewModel();

            if (mainActivityId > 0)
            {
                var mainActivities = await _mainActivityMasterHelper.GetAllMainActivityMasterDetails("", mainActivityId, 1);

                if (mainActivities != null)
                {
                    mainAcitivity.MainActivityId          = mainActivities[0].MainActivityId;
                    mainAcitivity.GroupId                 = mainActivities[0].GroupId;
                    mainAcitivity.MainActivityName        = mainActivities[0].MainActivityName;
                    mainAcitivity.MainActivityCode        = mainActivities[0].MainActivityCode;
                    mainAcitivity.OrgId                   = mainActivities[0].OrgId;
                    mainAcitivity.Sequence                = mainActivities[0].Sequence;
                    mainAcitivity.Status                  = mainActivities[0].Status;
                    mainAcitivity.MainActivityDescription = mainActivities[0].MainActivityDescription;
                }
            }
            mainAcitivity.lstGroupMaster = lstGroupMaster;
            //MainActivityMasterViewModel mainActivityModel = new MainActivityMasterViewModel()
            //{
            //    lstGroupMaster = lstGroupMaster
            //};
            return(PartialView("SaveMainActivity", mainAcitivity));
        }