private UserGeneralInformationBM ConvertToBM(UserGeneralInfomation model)
        {
            UserBL userBL = new UserBL();
            if (model == null)
                return null;
            else
                return new UserGeneralInformationBM()
                {
                    Id = model.Id,

                    Address1 = model.Address1,
                    Address2 = model.Address2,
                    PhoneNumber = model.PhoneNumber,
                    FatherName = model.FatherName,
                    Status = model.Status,

                    CommunityId = userBL.GetUserById(model.UserId).CommunityId,
                    SubCommunityId = userBL.GetUserById(model.UserId).SubCommunityId,
                    Image = model.Image,
                    CreatedBy = model.CreatedBy,
                    CreationDate = model.CreationDate,
                    UserId = model.UserId,
                    ModifiedBy = model.ModifiedBy,
                    ModificationDate = model.ModificationDate
                };
        }
Esempio n. 2
0
        public List<FriendBM> GetUsersWithFriendStatus(string SearchString, int UserId, DataTableParams param)
        {
            UserBL userObj = new UserBL();
            CurrentUser = UserId;

            List<UserBM> Users = userObj.GeteUserByName(SearchString,param).Where(x=>x.Id != UserId).ToList();
            return Users.ConvertAll<FriendBM>(new Converter<UserBM, FriendBM>(ConvertToFriendBM));
        }
Esempio n. 3
0
 public int GetUserCountByName(string name)
 {
     UserBL user = new UserBL();
     return user.GetUserCountByName(name);
 }
Esempio n. 4
0
        public ActionResult UpdatePersonalInformation(ProfileModel Model, FormCollection collection)
        {
            UserBM CurrentUser = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User);
            if (CurrentUser != null)
            {
                string test = collection["hdCommunityName"].ToString();
                string test2 = collection["hdSubCommunityName"].ToString();
                UserBL UserBL = new UserBL();
                CurrentUser.CountryId = Model.UserBM.CountryId;
                CurrentUser.StateId = Model.UserBM.StateId;
                CurrentUser.CityId = Model.UserBM.CityId;
                CurrentUser.CommunityId = Model.UserBM.CommunityId;
                CurrentUser.SubCommunityId = Model.UserBM.SubCommunityId;
                if (!string.IsNullOrEmpty(collection["hdCommunityName"].ToString()))
                    CurrentUser.CommunityName = collection["hdCommunityName"].ToString();
                if (!string.IsNullOrEmpty(collection["hdSubCommunityName"].ToString()))
                    CurrentUser.SubCommunityName = collection["hdSubCommunityName"].ToString();

                UserBL.UpdateUser(CurrentUser);
                SessionManager.InstanceCreator.Set<UserBM>(CurrentUser, SessionKey.User);
                TempData["Success"] = "Record saved Successfully.";

            }
            else
            {
                TempData["Error"] = "Please Login.";
            }

            return RedirectToAction("EditProfile");
        }
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 ActionResult LogOff()
        {
            UserBM User = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User);
            if (User != null)
            {
                User.IsOnline = false;
                UserBL userBL = new UserBL();
                userBL.UpdateUser(User);
            }
            FormsAuthentication.SignOut();

            return RedirectToAction("Login", "Account");
        }