Esempio n. 1
0
 public int Create(UserBM model)
 {
     User user = ConvertToDM(model);
     uow.UserRepository.Add(user);
     uow.Save();
     return user.Id;
 }
Esempio n. 2
0
        private ShareContactDetailBM ConvertToBM(ShareContactDetail model)
        {
            UserGeneralInformationBM usergeneralInfoBM = new UserGeneralInformationBM();
            UserProfessionalQualificationBM userProfessionalBM = new UserProfessionalQualificationBM();

            UserBM userBM=new UserBM();

            userBM=userBL.GetUserById(model.ShareUserId);

            usergeneralInfoBM = userGeneralInfoBL.GetGeneralInformationByUserId(model.ShareUserId);
            userProfessionalBM = userProfessionalQualificationBL.GetProfessionalQualificationByUserId(model.ShareUserId).FirstOrDefault();
            return new ShareContactDetailBM()
            {

              Id=model.Id,
              CurrentUserId=model.CurrentUserId,
              ShareUserId=model.ShareUserId,
              Message=model.Message,
              CreationDate=model.CreationDate,
              CreatedBy=model.CreatedBy,
              ModificationDate=model.ModificationDate,
              ModifiedBy=model.ModifiedBy,

             Email=userBM!=null? userBM.Email:"",
            Phone=usergeneralInfoBM !=null ?  usergeneralInfoBM.PhoneNumber :"",
            Company=userProfessionalBM !=null ?userProfessionalBM.CompanyName:"",
            //  Designation = userProfessionalBM != null ? userProfessionalBM.Designation : "",

              IsDeleted=model.IsDeleted,
              userBM = userBL.GetUserById(model.CurrentUserId)

            };
        }
Esempio n. 3
0
 public JsonResult LoadUserCommunityDetail()
 {
     UserBM CurrentUser = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User);
     UserBM userBM = new UserBM();
     if (CurrentUser != null)
         userBM = UserBL.GetUserById(CurrentUser.Id);
     return Json(userBM, JsonRequestBehavior.AllowGet);
 }
Esempio n. 4
0
        private FriendBM ConvertToFriendBM(UserBM model)
        {
            UserGeneralInformationBL userGeneralInfoBL = new UserGeneralInformationBL();
            UserGeneralInformationBM userGeneralInfoBM=new UserGeneralInformationBM();
            userGeneralInfoBM=userGeneralInfoBL.GetGeneralInformationByUserId(model.Id);
            FriendBM frnd = new FriendBM();

            frnd.UserId = CurrentUser;
            frnd.FriendName = model.Name;
            frnd.FriendCommunity = model.CommunityName;
            if (userGeneralInfoBM != null)
                frnd.FriendImage = string.IsNullOrEmpty(userGeneralInfoBM.Image) ? null : userGeneralInfoBM.Image;

            var friend = uow.FriendRepository.Find(x => x.UserId == CurrentUser && x.FriendId == model.Id).FirstOrDefault();
            if (friend == null)
            {
                frnd.FriendId = model.Id;
                frnd.FriendShipStatusId = 0;
            }
            else
            {
                frnd.Id = friend.Id;
                frnd.FriendShipStatusId = friend.FriendShipStatusId;
                frnd.FriendId = friend.FriendId;
                frnd.CreationDate = friend.CreationDate;
            }
            return frnd;
        }
Esempio n. 5
0
        public ActionResult Signup(UserModel model, FormCollection collection)
        {
            UserBL userBL = new UserBL();
            UserBM userBM = new UserBM();
            userBM.Name = model.Name;
            userBM.Email = model.Email;
            userBM.Password = model.Password;
            userBM.UserTypeId = Convert.ToInt32(collection["UserType"].ToString());
            userBM.DOB = Convert.ToDateTime(model.DOB);

            userBM.Gender = collection["gender"].ToString();

            userBM.Active = true;
            userBM.CommunityId = model.CommunityId;
            userBM.SubCommunityId = model.SubCommunityId;
            userBM.CountryId = model.CountryId;
            userBM.StateId = model.StateId;
            userBM.CityId = model.CityId;
            userBM.CommunityName = collection["hdCommunityName"].ToString();
            userBM.SubCommunityName = collection["hdSubCommunityName"].ToString();
            userBM.CreatedBy = 1;
            userBM.ModifiedBy = 1;

            userBM.CreationDate = DateTime.Now.Date;
            userBM.ModificationDate = DateTime.Now.Date;

            int userId = userBL.Create(userBM);

            FillUserGeneralInformation(userId);
            TempData[Message.Success] = "User Registered Successfully. Please Login.";
            // If we got this far, something failed, redisplay form
            return RedirectToAction("Login");
        }
Esempio n. 6
0
 public void CreateUser(UserBM model)
 {
     uow.UserRepository.Add(ConvertToDM(model));
     uow.Save();
 }
Esempio n. 7
0
        private User ConvertToDM(UserBM model)
        {
            if (model == null)
                return null;
            else
            return new User
            {
                Id=model.Id,
                Name = model.Name,
                Email = model.Email,
                Password=model.Password,
                UserTypeId=model.UserTypeId,
                DOB=model.DOB,
                Gender=model.Gender,
                CommunityId=model.CommunityId,
                CommunityName=model.CommunityName,
                SubCommunityId=model.SubCommunityId,
                SubCommunityName=model.SubCommunityName,
                Active = model.Active,
                CreationDate=model.CreationDate,
                CreatedBy=model.CreatedBy,
                ModifiedBy = model.ModifiedBy,
                ModificationDate = model.ModificationDate,
                CityId=model.CityId,
                StateId=model.StateId,

                CountryId=model.CountryId,

                IsOnline = model.IsOnline

            };
        }
Esempio n. 8
0
 public void UpdateUser(UserBM model)
 {
     uow.UserRepository.Update(ConvertToDM(model));
     uow.Save();
 }