示例#1
0
 /// <summary>
 /// CreatedDate:23-Nov-2017
 /// Desc:Update record of Individual Users
 /// </summary>
 /// <param name="objIndividualRegistrationViewModel"></param>
 /// <returns></returns>
 public bool UpdateIndividualClient(IndividualRegistrationViewModel objIndividualRegistrationViewModel)
 {
     try
     {
         using (DataContext = new DmsDomainContext())
         {
             Individual objIndividual = new Individual();
             objIndividual              = DataContext.Individuals.Where(x => x.IndividualRecordId == objIndividualRegistrationViewModel.IndividualRecordId).FirstOrDefault();
             objIndividual.FirstName    = objIndividualRegistrationViewModel.FirstName;
             objIndividual.MiddleName   = objIndividualRegistrationViewModel.MiddleName;
             objIndividual.LastName     = objIndividualRegistrationViewModel.LastName;
             objIndividual.BirthDate    = Convert.ToDateTime(objIndividualRegistrationViewModel.BirthDate);
             objIndividual.Prefix       = objIndividualRegistrationViewModel.Prefix;      //1 for Mr., 2 for Ms.
             objIndividual.Suffix       = objIndividualRegistrationViewModel.Suffix;
             objIndividual.SSN          = Convert.ToString(objIndividualRegistrationViewModel.SSN);
             objIndividual.Phone        = objIndividualRegistrationViewModel.Phone;
             objIndividual.ModifiedDate = DateTime.Now;
             objIndividual.ModifiedBy   = objIndividualRegistrationViewModel.IndividualRecordId;
             objIndividual.IsDeleted    = false;
             DataContext.SaveChanges();
             return(true);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
示例#2
0
        public async Task <IActionResult> IndividualRegistration(int id)
        {
            /* New instance */
            IndividualRegistrationViewModel IModel = new IndividualRegistrationViewModel();

            /* Get the tournament info */
            IModel.Tournament = await db.Tournament.
                                Include(s => s.SportType).
                                Include(r => r.RegisterType).
                                Include(t => t.TournamentType).
                                Include(g => g.GenderType).
                                FirstOrDefaultAsync(t => t.TournamentId == id);

            /* Get the logged in user */
            ApplicationUser user = await userManager.GetUserAsync(User);

            if (user == null) /* something went wrong */
            {
                await signInManager.SignOutAsync();

                return(RedirectToAction(nameof(AccountController.Login), "Account", new { returnUrl = $"/Registration/{nameof(RegistrationController.IndividualRegistration)}/{id}" }));
            }
            /* Set the objects user */
            IModel.User = user;

            return(View(IModel));
        }
        /// <summary>
        /// CreatedDate:23-Nov-2017
        /// Desc:Get detail of Individual Client
        /// </summary>
        /// <returns></returns>
        public ActionResult GetIndividualClientDetail()
        {
            IndividualRegistrationViewModel _detail = _IndividualService.GetIndividualClientDetail(SessionManagement.LoggedInUser.UserId);

            ViewBag.Prefix = CommonFunction.GetPrefix();
            return(PartialView("_EditIndividualPartial", _detail));
            //return Json(_detail, JsonRequestBehavior.AllowGet);
        }
        /// <summary>
        /// CreatedDate:25-Nov-2017
        /// Desc:To update the individual client's profile
        /// </summary>
        /// <returns></returns>
        public ActionResult EditProfile()
        {
            IndividualRegistrationViewModel _detail = _IndividualService.GetIndividualClientDetail(SessionManagement.LoggedInUser != null ? SessionManagement.LoggedInUser.UserId : 0);

            _detail.lstPrefix = CommonFunction.GetPrefix();
            if (!string.IsNullOrEmpty(Convert.ToString(TempData["Message"])))
            {
                ViewBag.Message = TempData["Message"];
            }
            return(View(_detail));
        }
        private IndividualRegistrationViewModel DetailForIndividualClient(FormCollection formCollection)
        {
            IndividualRegistrationViewModel _IndividualDetail = new IndividualRegistrationViewModel();

            _IndividualDetail.IndividualRecordId = Convert.ToInt64(formCollection["IndividualRecordId"]);
            _IndividualDetail.Prefix             = formCollection["Prefix"];
            _IndividualDetail.FirstName          = formCollection["FirstName"];
            _IndividualDetail.MiddleName         = formCollection["MiddleName"];
            _IndividualDetail.LastName           = formCollection["LastName"];
            _IndividualDetail.BirthDate          = formCollection["BirthDate"];
            _IndividualDetail.SSN    = formCollection["SSN"];
            _IndividualDetail.Phone  = formCollection["Phone"];
            _IndividualDetail.Suffix = formCollection["Suffix"];
            return(_IndividualDetail);
        }
 public ActionResult EditIndividualProfile(IndividualRegistrationViewModel _IndividualDetail)
 {
     try
     {
         bool _result = _IndividualService.UpdateIndividualClient(_IndividualDetail);
         if (_result == true)
         {
             TempData["Message"] = "Information Updated Successfully";
         }
         return(RedirectToAction("EditProfile"));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
示例#7
0
 public ActionResult Register(IndividualRegistrationViewModel IndividualRegistrationModel)
 {
     try
     {
         bool _result = _iAcconutService.InsertIndividualClient(IndividualRegistrationModel);
         if (_result == true)
         {
             TempData["Result"] = "You have successfully registered.";
         }
         else
         {
             TempData["Result"] = "Error occured while registeration";
         }
         return(RedirectToAction("Register"));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
示例#8
0
 /// <summary>
 /// CreatedDate:23-Nov-2017
 /// Desc:Get Detail of Individual Users
 /// </summary>
 /// <returns></returns>
 public IndividualRegistrationViewModel GetIndividualClientDetail(long?UserID)
 {
     using (DataContext = new DmsDomainContext())
     {
         User objUser = new User();
         objUser = DataContext.Users.Where(x => x.UserId == UserID).FirstOrDefault();
         IndividualRegistrationViewModel objIndividualRegistrationViewModel = new IndividualRegistrationViewModel();
         objIndividualRegistrationViewModel.IndividualRecordId = objUser.IndividualRecordId;
         objIndividualRegistrationViewModel.FirstName          = objUser.Individual.FirstName;
         objIndividualRegistrationViewModel.MiddleName         = objUser.Individual.MiddleName;
         objIndividualRegistrationViewModel.LastName           = objUser.Individual.LastName;
         objIndividualRegistrationViewModel.BirthDate          = Convert.ToDateTime(objUser.Individual.BirthDate).ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
         objIndividualRegistrationViewModel.SSN          = objUser.Individual.SSN;
         objIndividualRegistrationViewModel.Prefix       = objUser.Individual.Prefix;
         objIndividualRegistrationViewModel.Suffix       = objUser.Individual.Suffix;
         objIndividualRegistrationViewModel.Phone        = objUser.Individual.Phone;
         objIndividualRegistrationViewModel.UserName     = objUser.UserName;
         objIndividualRegistrationViewModel.EmailAddress = objUser.Email;
         return(objIndividualRegistrationViewModel);
     }
 }
示例#9
0
 /// <summary>
 /// CreatedDate:21-Nov-2017
 /// Desc:Insert data for the Indvidual clients.
 /// </summary>
 /// <param name="objIndividualRegistrationViewModel"></param>
 /// <returns></returns>
 public bool InsertIndividualClient(IndividualRegistrationViewModel objIndividualRegistrationViewModel)
 {
     try
     {
         if (objIndividualRegistrationViewModel.IsIndividualClient == 1)                          // For the main domain Individual Clients
         {
             Individual objIndividual = new Individual();
             objIndividual.FirstName    = objIndividualRegistrationViewModel.FirstName;
             objIndividual.MiddleName   = objIndividualRegistrationViewModel.MiddleName;
             objIndividual.LastName     = objIndividualRegistrationViewModel.LastName;
             objIndividual.BirthDate    = Convert.ToDateTime(objIndividualRegistrationViewModel.BirthDate);
             objIndividual.Prefix       = objIndividualRegistrationViewModel.Prefix;      //1 for Mr., 2 for Ms.
             objIndividual.Suffix       = objIndividualRegistrationViewModel.Suffix;
             objIndividual.SSN          = Convert.ToString(objIndividualRegistrationViewModel.SSN);
             objIndividual.Phone        = objIndividualRegistrationViewModel.Phone;
             objIndividual.EmailAddress = objIndividualRegistrationViewModel.EmailAddress.ToLower();
             objIndividual.CreatedDate  = DateTime.Now;
             objIndividual.IsDeleted    = false;
             objIndividual.IsActive     = true;
             uow.Repository <Individual>().Add(objIndividual);
             uow.SaveChanges();
             UserViewModel objUserModel = new UserViewModel();
             objUserModel.IndividualRecordId = objIndividual.IndividualRecordId;
             objUserModel.Email    = objIndividualRegistrationViewModel.EmailAddress.ToLower();
             objUserModel.UserName = objIndividualRegistrationViewModel.UserName.ToLower();
             objUserModel.Password = CommonFunction.EncryptPassword(objIndividualRegistrationViewModel.Password);
             AddUser(objUserModel);
             return(true);
         }
         else
         {
             // For the Accounting firm
             return(true);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
示例#10
0
        public async Task <IActionResult> IndividualOrTeamRegistration(int id)
        {
            /* New instance */
            TeamRegistrationViewModel TModel = new TeamRegistrationViewModel();

            /* New instance of the IndividualRegistrationModel */
            IndividualRegistrationViewModel IModel = new IndividualRegistrationViewModel();

            TModel.IndividualRegistrationViewModel = IModel;

            /* Get the tournament info */
            Tournament tournament = await db.Tournament.
                                    Include(s => s.SportType).
                                    Include(r => r.RegisterType).
                                    Include(t => t.TournamentType).
                                    Include(g => g.GenderType).
                                    FirstOrDefaultAsync(t => t.TournamentId == id);

            /* Set the tournament property */
            TModel.IndividualRegistrationViewModel.Tournament = tournament;

            /* Get the logged in user */
            ApplicationUser user = await userManager.GetUserAsync(User);

            if (user == null) /* something went wrong */
            {
                await signInManager.SignOutAsync();

                return(RedirectToAction(nameof(AccountController.Login), "Account", new { returnUrl = $"/Registration/{nameof(RegistrationController.IndividualOrTeamRegistration)}/{id}" }));
            }
            /* Set the objects user */
            TModel.IndividualRegistrationViewModel.User = user;

            /* Get the teams the user is contactperson for */
            TModel.Teams = db.Team.Where(u => u.User.Id == user.Id).ToList();

            return(View(TModel));
        }
示例#11
0
 public bool UpdateIndividualClient(IndividualRegistrationViewModel IndividualRegistrationViewModel)
 {
     return(_IIndividualRepository.UpdateIndividualClient(IndividualRegistrationViewModel));
 }
示例#12
0
 public bool InsertIndividualClient(IndividualRegistrationViewModel individualRegistrationModel)
 {
     return(_IAccountRepository.InsertIndividualClient(individualRegistrationModel));
 }