Exemplo n.º 1
0
        public async Task <IActionResult> Index()
        {
            var mainActivityMasterList = await _mainActivityMasterHelper.GetAllMainActivityMasterDetails();

            List <MainActivityMasterViewModel> lstMainActivityMasters = new List <MainActivityMasterViewModel>();

            //lstMainActivityMasters = mainActivityMasterList;
            if (mainActivityMasterList.Count > 0)
            {
                foreach (var item in mainActivityMasterList)
                {
                    string groupName    = string.Empty;
                    var    groupDetails = await _groupMasterHelper.GetGroupMasterViewModelById(item.GroupId);

                    if (groupDetails != null)
                    {
                        groupName = groupDetails[0].GroupName;
                    }
                    MainActivityMasterViewModel mainActivity = new MainActivityMasterViewModel()
                    {
                        MainActivityId   = item.MainActivityId,
                        GroupId          = item.GroupId,
                        GroupName        = groupName,
                        MainActivityName = item.MainActivityName,
                        OrgId            = item.OrgId,
                        Sequence         = item.Sequence,
                        Status           = item.Status,
                        IsDeleted        = item.Status
                    };
                    lstMainActivityMasters.Add(mainActivity);
                }
            }
            return(View(lstMainActivityMasters));
        }
        public async Task <IActionResult> SaveGroupMaster(int groupId = 0)
        {
            GroupMasterViewModel grpItem = new GroupMasterViewModel();

            if (groupId > 0)
            {
                var groupMasterItem = await _groupMasterHelper.GetGroupMasterViewModelById(groupId);

                if (groupMasterItem.Count > 0)
                {
                    grpItem.GroupId          = Convert.ToInt32(groupMasterItem[0].GroupId);
                    grpItem.GroupCode        = groupMasterItem[0].GroupCode;
                    grpItem.GroupName        = groupMasterItem[0].GroupName;
                    grpItem.Sequence         = groupMasterItem[0].Sequence;
                    grpItem.Status           = groupMasterItem[0].Status;
                    grpItem.IsDeleted        = true;
                    grpItem.GroupDescription = groupMasterItem[0].GroupDescription;
                }
            }
            return(PartialView("SaveGroupMaster", grpItem));
        }