Esempio n. 1
0
        //  public List<Designa> IndustryList { get; set; }

        public ProfileModel()
        {
            UserProfessionalQualificationModel = new UserProfessionalQualificationBM();
            IndustryList = commonBL.GetIndustry();
            DegreeList   = commonBL.GetDegree();
            UserGeneralInformationModel        = new UserGeneralInformationBM();
            UserPersonalInformationModel       = new UserPersonalInformationBM();
            UserProfessionalQualificationModel = new UserProfessionalQualificationBM();
            UserQualificatinModel = new UserQualificatinBM();
            UserVideoModel        = new UserVideoBM();
        }
Esempio n. 2
0
        public JsonResult GetUserGeneralDetail()
        {
            CommunityBL communityBL = new CommunityBL();
            UserBM      CurrentUser = (UserBM)Session["User"];
            UserGeneralInformationBM UserGeneralInformationBM = new UserGeneralInformationBM();

            if (CurrentUser != null)
            {
                UserGeneralInformationBM = UserGeneralInformationBL.GetGeneralInformationByUserId(CurrentUser.Id);
                UserGeneralInformationBM.SubCommunityName = communityBL.GetCommunityById(UserGeneralInformationBM.SubCommunityId).Name;
            }
            return(Json(UserGeneralInformationBM, JsonRequestBehavior.AllowGet));
        }
 private UserGeneralInfomation ConvertToDM(UserGeneralInformationBM model)
 {
     return(new UserGeneralInfomation
     {
         Id = model.Id,
         CommunityId = model.CommunityId,
         SubCommunityId = model.SubCommunityId,
         Image = model.Image,
         Active = model.Active,
         CreatedBy = model.CreatedBy,
         CreationDate = model.CreationDate,
         UserId = model.UserId,
         ModifiedBy = model.ModifiedBy,
         ModificationDate = model.ModificationDate
     });
 }
 public void Update(UserGeneralInformationBM model)
 {
     uow.UserGeneralInfomationRepository.Update(ConvertToDM(model));
     uow.Save();
 }
Esempio n. 5
0
        public ActionResult UpdateGeneralInformation(ProfileModel Model, HttpPostedFileBase file)
        {
            UserBM CurrentUser = (UserBM)Session["User"];

            if (CurrentUser != null)
            {
                if (Model.UserGeneralInformationModel.Id == 0)
                {
                    if (file != null)
                    {
                        UserGeneralInformationBL UserGeneralInformationBL = new BL.BusinessLayer.UserGeneralInformationBL();

                        string ImageName    = System.IO.Path.GetFileName(file.FileName);
                        string physicalPath = Server.MapPath("~/Images/" + ImageName);
                        file.SaveAs(physicalPath);
                        UserGeneralInformationBM UserGeneralInformation = new UserGeneralInformationBM();
                        UserGeneralInformation.CommunityId    = Model.UserGeneralInformationModel.CommunityId;
                        UserGeneralInformation.SubCommunityId = Model.UserGeneralInformationModel.SubCommunityId;
                        UserGeneralInformation.Image          = "/Images/" + ImageName;
                        UserGeneralInformation.UserId         = CurrentUser.Id;
                        UserGeneralInformation.CreatedBy      = CurrentUser.Id;
                        UserGeneralInformation.CreationDate   = DateTime.Now;
                        UserGeneralInformationBL.Create(UserGeneralInformation);


                        if (!string.IsNullOrEmpty(Model.UserGeneralInformationModel.Password))
                        {
                            CurrentUser.Password = Model.UserGeneralInformationModel.Password;
                            UserBL userBL = new UserBL();
                            CurrentUser.CreationDate = DateTime.Now;
                            userBL.UpdateUser(CurrentUser);
                            Session["User"] = CurrentUser;
                        }
                        TempData["Success"] = "Record saved Successfully.";
                    }
                }
                else
                {
                    //update code
                    UserGeneralInformationBM UserGeneralInformationBM = UserGeneralInformationBL.GetGeneralInformationByUserId(CurrentUser.Id);
                    UserGeneralInformationBM.CommunityId    = Model.UserGeneralInformationModel.CommunityId;
                    UserGeneralInformationBM.SubCommunityId = Model.UserGeneralInformationModel.SubCommunityId;
                    // UserGeneralInformationBM.Image = "/Images/" + ImageName;
                    if (file != null)
                    {
                        string ImageName    = System.IO.Path.GetFileName(file.FileName);
                        string physicalPath = Server.MapPath("~/Images/" + ImageName);
                        file.SaveAs(physicalPath);
                        UserGeneralInformationBM.Image = "/Images/" + ImageName;
                    }
                    UserGeneralInformationBM.UserId           = CurrentUser.Id;
                    UserGeneralInformationBM.ModifiedBy       = CurrentUser.Id;
                    UserGeneralInformationBM.ModificationDate = DateTime.Now;
                    UserGeneralInformationBL.Update(UserGeneralInformationBM);
                }
            }
            else
            {
                TempData["Error"] = "Please Login.";
            }

            return(RedirectToAction("Profile"));
        }