Exemple #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> SaveActivityMaster(int activityId = 0)
        {
            var mainActivityMasters = await _mainActivityMasterHelper.GetAllMainActivityMasterDetails();

            List <MainActivityMasterViewModel> lstMainActivityMaster = new List <MainActivityMasterViewModel>();
            ActivityMasterViewModel            activityMasterModel   = new ActivityMasterViewModel();

            if (mainActivityMasters != null)
            {
                foreach (var item in mainActivityMasters)
                {
                    lstMainActivityMaster.Add(new MainActivityMasterViewModel()
                    {
                        MainActivityId   = item.MainActivityId,
                        MainActivityCode = item.MainActivityCode
                    });
                }
            }

            if (activityId > 0)
            {
                var activityMasterList = await _activityMasterHelper.GetAllActivityMasterDetails("", activityId, 1);

                if (activityMasterList != null)
                {
                    activityMasterModel.ActivityId          = activityMasterList[0].ActivityId;
                    activityMasterModel.MainActivityId      = activityMasterList[0].MainActivityId;
                    activityMasterModel.ActivityName        = activityMasterList[0].ActivityName;
                    activityMasterModel.ActivityCode        = activityMasterList[0].ActivityCode;
                    activityMasterModel.OrgId               = 1;
                    activityMasterModel.ParentId            = 1;
                    activityMasterModel.Sequence            = activityMasterList[0].Sequence;
                    activityMasterModel.Status              = activityMasterList[0].Status;
                    activityMasterModel.IsDeleted           = false;
                    activityMasterModel.ActivityDescription = activityMasterList[0].ActivityDescription;
                }
            }
            activityMasterModel.lstMainActivityMaster = lstMainActivityMaster;
            //ActivityMasterViewModel activityMasterModel = new ActivityMasterViewModel()
            //{
            //    lstMainActivityMaster = lstMainActivityMaster
            //};
            return(PartialView("SaveActivityMaster", activityMasterModel));
        }
Exemple #3
0
        public async Task <IActionResult> SaveVarianceMaster(int varianceId = 0)
        {
            var mainActivityMasters = await _mainActivityMasterHelper.GetAllMainActivityMasterDetails();

            List <MainActivityMasterViewModel> lstMainActivityMaster = new List <MainActivityMasterViewModel>();
            VarianceMasterViewModel            variMasterModel       = new VarianceMasterViewModel();

            if (mainActivityMasters != null)
            {
                foreach (var item in mainActivityMasters)
                {
                    lstMainActivityMaster.Add(new MainActivityMasterViewModel()
                    {
                        MainActivityId   = item.MainActivityId,
                        MainActivityCode = item.MainActivityCode
                    });
                }
            }

            if (varianceId > 0)
            {
                var varianceMasterList = await _varianceMasterHelper.GetAllVarianceMasterDetails("", varianceId, 1);

                if (varianceMasterList != null)
                {
                    variMasterModel.VarianceId          = varianceMasterList[0].VarianceId;
                    variMasterModel.MainActivityId      = varianceMasterList[0].MainActivityId;
                    variMasterModel.VarianceName        = varianceMasterList[0].VarianceName;
                    variMasterModel.VarianceCode        = varianceMasterList[0].VarianceCode;
                    variMasterModel.ParentId            = varianceMasterList[0].ParentId;
                    variMasterModel.OrgId               = varianceMasterList[0].OrgId;
                    variMasterModel.Status              = varianceMasterList[0].Status;
                    variMasterModel.Sequence            = varianceMasterList[0].Sequence;
                    variMasterModel.IsDeleted           = varianceMasterList[0].IsDeleted;
                    variMasterModel.VarianceDescription = varianceMasterList[0].VarianceDescription;
                }
            }
            variMasterModel.lstMainActivityMaster = lstMainActivityMaster;

            return(PartialView("SaveVarianceMaster", variMasterModel));
        }