コード例 #1
0
        public ActionResult EditCgp(FirmInstitutionAdviserViewModel _adviser)
        {
            #region "Update user"

            var nui = _adviser.User;
            var ui = UserBL.GetUserById(nui.IdUser);
            if (ui != null)
            {
                ui.UserName = nui.UserName;
                ui.Civility = nui.UserCivilite;
                ui.UserFirstName = nui.UserFirstName;
                ui.UserMobilePhone = nui.UserMobilePhone;
                ui.UserLogin = nui.UserEmail;
                ui.UserEmail = nui.UserEmail;
                UserBL.UpdateUser(ui);
            }
            #endregion

            #region "Update firm"

            var nfi = _adviser.FirmInstitution;
            var fi = FirmInstitutionBL.GetFirmInstitutionByIdFirmInstitution(nfi.IdFirmInstitution);
            if (fi != null)
            {
                fi.FirmInstitutionName = nfi.FirmInstitutionName;
                FirmInstitutionBL.UpdateFirmInstitution(fi);
            }
            #endregion

            var idCustomer = SessionManager.GetUserSession().idUser;

            var lstFirmAdv = new List<Upsilab.Business.Configuration.Models.FirmInstitutionAdviserViewModel>();
            var lst = FrProviderUserCGPUserBL.GetCgpListByCustomer(idCustomer);
            var lstIdUser = new List<Guid>();
            if (lst != null && lst.Any())
            {
                lstIdUser = new HashSet<Guid>(lst.Select(u => u.idUser)).ToList();
                lstFirmAdv = FirmInstitutionAdviserBL.GetFirmInstitutionAdvisersByUserList(lstIdUser);
            }
            return PartialView("ListingModifierSupprimerCGPPartial", lstFirmAdv);
        }
コード例 #2
0
        public ActionResult Create(FirmInstitutionAdviserViewModel _adviser)
        {
            var idCustomer = SessionManager.GetUserSession().idUser;
            FrProviderUserCGPUserBL.CreateCgp(idCustomer, _adviser.ToEntity());

            var lstFirmAdv = new List<Upsilab.Business.Configuration.Models.FirmInstitutionAdviserViewModel>();
            var lst = FrProviderUserCGPUserBL.GetCgpListByCustomer(idCustomer);
            var lstIdUser = new List<Guid>();
            if (lst != null && lst.Any())
            {
                lstIdUser = new HashSet<Guid>(lst.Select(u => u.idUser)).ToList();
                lstFirmAdv = FirmInstitutionAdviserBL.GetFirmInstitutionAdvisersByUserList(lstIdUser);
            }
            return PartialView("ListingCGPPartial", lstFirmAdv);
        }