Exemple #1
0
 public Alumini.Core.ProfessionalDetail UpdateUserProfDetails(int id, ProfessionalDetail Prof)
 {
     using (var context = _dbContextFactory.CreateConnection())
     {
         try
         {
             int Count = context.ProfessionalDetails.Where(x => x.UserId == id).Count();
             if (Count != 0)
             {
                 ProfessionalDetail Profdetails = context.ProfessionalDetails.Where(x => x.UserId == id).First();
                 Profdetails.Company     = Prof.Company;
                 Profdetails.Designation = Prof.Designation;
                 Profdetails.WorkedFrom  = Prof.WorkedFrom;
                 Profdetails.WorkedTill  = Prof.WorkedTill;
                 context.SaveChanges();
             }
             else
             {
                 Prof.Status = true;
                 Prof.UserId = id;
                 context.ProfessionalDetails.Add(Prof);
                 context.SaveChanges();
             }
             return(Prof);
         }
         catch (Exception ex)
         {
             _Logger.Error(ex.Message, ex);
             throw ex;
         }
     }
 }
Exemple #2
0
 public int SaveProfessionalDetails(ProfessionalDetail ProfessionModel)
 {
     try
     {
         var existscount = dbContext.ProfessionalDetails.Where(b => b.PhoneNumber == ProfessionModel.PhoneNumber).FirstOrDefault();
         if (existscount == null)
         {
             dbContext.ProfessionalDetails.Add(ProfessionModel);
             dbContext.SaveChanges();
             return(100);
         }
         else
         {
             return(200);
         }
     }
     catch (Exception ex)
     {
         ErrorLogDal objError = new ErrorLogDal();
         ErrorLog    model    = new ErrorLog();
         model.InnerException = ex.InnerException.InnerException.Message.ToString();
         model.Source         = "Save Professional Details";
         int error = objError.InsertError(model);
         return(400);
     }
 }
        public string GetDetails(string PhoneNumber)
        {
            try
            {
                ProfessionalDetail model            = new ProfessionalDetail();
                ProfessionalDetail ProfessionRecord = objProfession.FetchProfessionalDetails(PhoneNumber);
                if (ProfessionRecord == null)
                {
                    return("300");
                }
                else
                {
                    model.ProfessionalDetailsId = ProfessionRecord.ProfessionalDetailsId;
                    model.CompanyName           = ProfessionRecord.CompanyName;
                    model.MonthlyIncome         = ProfessionRecord.MonthlyIncome;
                    model.YearOfExperience      = ProfessionRecord.YearOfExperience;
                    model.CurrentEMI            = ProfessionRecord.CurrentEMI;
                    model.CompanyAddress        = ProfessionRecord.CompanyAddress;
                    model.CompanyEmailId        = ProfessionRecord.CompanyEmailId;
                    model.PhoneNumber           = ProfessionRecord.PhoneNumber;

                    string jsonResult = JsonConvert.SerializeObject(model, Formatting.Indented);
                    return(jsonResult);
                }
            }
            catch (Exception ex)
            {
                ErrorLogDal objError = new ErrorLogDal();
                ErrorLog    model    = new ErrorLog();
                model.InnerException = ex.InnerException.InnerException.Message.ToString();
                model.Source         = "ProfessionalDetails-Get";
                int error = objError.InsertError(model);
                return("400");
            }
        }
Exemple #4
0
        public ActionResult ProfessionalDetails()
        {
            if (Session["UserId"] != null)
            {
                int UserId = Convert.ToInt32(Session["UserId"].ToString());
                ProfessionalDetail Profdetails      = Professionaldetailsservice.Get(UserId);
                List <Graduation>  _GraduationYears = new List <Graduation>();

                DateTime CurrentDate = DateTime.Now;
                int      Year        = CurrentDate.Year;
                for (int i = 1970; i <= Year; i++)
                {
                    _GraduationYears.Add(new Graduation {
                        GraduationYear = "" + i, GraduationYearId = i
                    });
                }
                ProfessionalDetails details = new ProfessionalDetails()
                {
                    Company         = Profdetails.Company,
                    Designation     = Profdetails.Designation,
                    WorkedFrom      = Profdetails.WorkedFrom,
                    WorkedTill      = Profdetails.WorkedTill,
                    GraduationYears = _GraduationYears
                };
                return(View(details));
            }
            return(RedirectToAction("Login", "Account"));
        }
Exemple #5
0
        public ActionResult ProfessionalDetails(ProfessionalDetails Profdetails)
        {
            if (ModelState.IsValid)
            {
                if (Session["UserId"] != null)
                {
                    UserDetail userdetails = new UserDetail()
                    {
                        Id = Convert.ToInt32(Session["UserId"].ToString()),
                        ProfileInfoPercentage = (int)CustomStatus.ProfileInfoPercentage.Complete
                    };
                    ProfessionalDetail Profdetail = new ProfessionalDetail()
                    {
                        UserId      = Convert.ToInt32(Session["UserId"].ToString()),
                        Status      = true,
                        Company     = Profdetails.Company,
                        Designation = Profdetails.Designation,
                        WorkedFrom  = Profdetails.WorkedFrom,
                        WorkedTill  = Profdetails.WorkedTill
                    };
                    UserService.UpdateUser(userdetails);
                    Professionaldetailsservice.Create(Profdetail);
                    Session.Clear();
                    TempData["Success"] = "your registration process is sucessfully completed..";
                    return(RedirectToAction("Login"));
                }
                else
                {
                    return(RedirectToAction("Login"));
                }
            }
            var Date = DateTime.Now.Year;
            List <Graduation> _GraduationYears = new List <Graduation>();

            for (int i = 1970; i <= Date; i++)
            {
                _GraduationYears.Add(new Graduation {
                    GraduationYear = "" + i, GraduationYearId = i
                });
            }
            ProfessionalDetails details = new ProfessionalDetails()
            {
                GraduationYears = _GraduationYears
            };

            return(View(details));
        }
Exemple #6
0
 public ActionResult ProfessionalDetails(ProfessionalDetails Profdetails)
 {
     if (Session["UserId"] != null)
     {
         int UserId = Convert.ToInt32(Session["UserId"].ToString());
         if (ModelState.IsValid)
         {
             ProfessionalDetail Profdetail = new ProfessionalDetail()
             {
                 Company     = Profdetails.Company,
                 Designation = Profdetails.Designation,
                 WorkedFrom  = Profdetails.WorkedFrom,
                 WorkedTill  = Profdetails.WorkedTill
             };
             ProfessionalDetailsservice.UpdateUserProfDetails(UserId, Profdetail);
             TempData["Success"] = UtilitiesClass.SuccessMessage;
             return(RedirectToAction("Profile", "Profile", new { area = "Alumini" }));
         }
         ProfessionalDetail ProfDet          = ProfessionalDetailsservice.Get(UserId);
         List <Graduation>  _GraduationYears = new List <Graduation>();
         for (int i = 1970; i <= 2015; i++)
         {
             _GraduationYears.Add(new Graduation {
                 GraduationYear = "" + i, GraduationYearId = i
             });
         }
         ProfessionalDetails details = new ProfessionalDetails()
         {
             Company         = Profdetails.Company,
             Designation     = ProfDet.Designation,
             WorkedFrom      = ProfDet.WorkedFrom,
             WorkedTill      = ProfDet.WorkedTill,
             GraduationYears = _GraduationYears
         };
         return(View(details));
     }
     else
     {
         return(RedirectToAction("Login", "Account", new { area = "" }));
     }
 }
Exemple #7
0
        public ActionResult saveAlumniSurveyToServer(String survey, string alumniID)
        {
            AlumniUsersAuthenticate alumniUsersAuthenticate = Session["user"] as AlumniUsersAuthenticate;

            using (var db = Util.getContext())
            {
                AlumniUsersAuthenticate alumni = db.AlumniUsersAuthenticates
                                                 .Where(e => e.alumni_username == alumniUsersAuthenticate.alumni_username).Single();
                alumni.alumni_survey_status = "Filled";
                db.SaveChanges();
                ProfessionalDetail professionalDetail = db.ProfessionalDetails.Where(e => e.alumni_id == alumniID).ToList().Last();
                Util.sendEmailToEmployeer(professionalDetail.supervisor_email, alumniID);
            }

            using (Stream stream = Util.GenerateStreamFromString(survey))
            {
                byte[] buffer = new byte[stream.Length];
                stream.Read(buffer, 0, buffer.Length);
                try
                {
                    var folder = System.Web.HttpContext.Current.Server.MapPath("~/AlumniSurveyrs/" + alumniUsersAuthenticate.alumni_username);
                    if (!Directory.Exists(folder))
                    {
                        Directory.CreateDirectory(folder);
                        string path = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/AlumniSurveyrs/" + alumniUsersAuthenticate.alumni_username),
                                                   Path.GetFileName(alumniUsersAuthenticate.alumni_name + ".pdf"));
                        System.IO.File.WriteAllBytes(path, buffer);
                    }
                    else
                    {
                        string path = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/AlumniSurveyrs/" + 1512232),
                                                   Path.GetFileName(alumniUsersAuthenticate.alumni_name + ".pdf"));
                        System.IO.File.WriteAllBytes(path, buffer);
                    }
                }
                catch (Exception ex)
                {
                }
            }
            return(RedirectToAction("employeeInformation"));
        }
Exemple #8
0
        public Provider GetByUserId(int userId)
        {
            ProfessionalDetail professionalDetail = null;
            TitleType          titleType          = null;
            GenderType         genderType         = null;
            Provider           provider           = null;
            UserProfile        userProfile        = null;
            string             procName           = "[dbo].[Users_UserProfiles_Providers_Join_Select_ByUserId_V2]";

            _data.ExecuteCmd(procName, inputParamMapper : delegate(SqlParameterCollection parameterCollection)
            {
                parameterCollection.AddWithValue("@UserId", userId);
            },
                             singleRecordMapper : delegate(IDataReader reader, short set)
            {
                provider = MapProvider(reader, professionalDetail, titleType, genderType, provider, userProfile);
            },
                             returnParameters: null);

            return(provider);
        }
Exemple #9
0
        private static Provider MapProvider(IDataReader reader, ProfessionalDetail professionalDetail, TitleType titleType, GenderType genderType, Provider provider, UserProfile userProfile)
        {
            int startingIndex = 0;

            provider          = new Provider();
            provider.Id       = reader.GetSafeInt32(startingIndex++);
            provider.Phone    = reader.GetSafeString(startingIndex++);
            provider.Fax      = reader.GetSafeString(startingIndex++);
            provider.Networks = reader.GetSafeString(startingIndex++);


            professionalDetail             = new ProfessionalDetail();
            provider.ProfessionalDetail    = professionalDetail;
            professionalDetail.Id          = reader.GetSafeInt32(startingIndex++);
            professionalDetail.NPI         = reader.GetSafeString(startingIndex++);
            professionalDetail.IsAccepting = reader.GetSafeBool(startingIndex++);

            titleType          = new TitleType();
            provider.TitleType = titleType;
            titleType.Id       = reader.GetSafeInt32(startingIndex++);
            titleType.Name     = reader.GetSafeString(startingIndex++);

            userProfile              = new UserProfile();
            provider.UserProfile     = userProfile;
            userProfile.Id           = reader.GetSafeInt32(startingIndex++);
            userProfile.FirstName    = reader.GetSafeString(startingIndex++);
            userProfile.LastName     = reader.GetSafeString(startingIndex++);
            userProfile.Mi           = reader.GetSafeString(startingIndex++);
            userProfile.AvatarUrl    = reader.GetSafeString(startingIndex++);
            userProfile.DateCreated  = reader.GetSafeDateTime(startingIndex++);
            userProfile.DateModified = reader.GetSafeDateTime(startingIndex++);

            genderType          = new GenderType();
            provider.GenderType = genderType;
            genderType.Id       = reader.GetSafeInt32(startingIndex++);
            genderType.Name     = reader.GetSafeString(startingIndex++);
            return(provider);
        }
Exemple #10
0
        public ActionResult ProfessionalDetails(String jobtitle, String companyname, String department, String worklocation,
                                                String worknumber, String email, String startdate, String supervisorname, String supervisoremail,
                                                String supervisorcontact)
        {
            AlumniUsersAuthenticate alumniUsersAuthenticate = Session["user"] as AlumniUsersAuthenticate;
            ProfessionalDetail      pd = new ProfessionalDetail();

            pd.job_title          = jobtitle;
            pd.company_name       = companyname;
            pd.department         = department;
            pd.work_location      = worklocation;
            pd.work_contact       = worknumber;
            pd.email              = email;
            pd.start_date         = startdate;
            pd.supervisor_name    = supervisorname;
            pd.supervisor_email   = supervisoremail;
            pd.supervisor_contact = supervisorcontact;
            pd.alumni_id          = alumniUsersAuthenticate.alumni_id;
            db.ProfessionalDetails.Add(pd);
            db.SaveChanges();
            List <ProfessionalDetail> professionalDetailList = db.ProfessionalDetails.ToList();

            return(View(professionalDetailList));
        }
Exemple #11
0
 public ProfessionalDetail UpdateUserProfDetails(int id, ProfessionalDetail Prof)
 {
     return(_professionaldetailreo.UpdateUserProfDetails(id, Prof));
 }
Exemple #12
0
 public ProfessionalDetail Create(ProfessionalDetail obj)
 {
     return(_professionaldetailreo.Create(obj));
 }
        public ActionResult ProfessionalDetails(ProfessionalDetails Profdetails)
        {
            if (Session["UserId"] != null)
            {
                int UserId = Convert.ToInt32(Session["UserId"].ToString());
                if (ModelState.IsValid)
                {

                    ProfessionalDetail Profdetail = new ProfessionalDetail()
                    {
                        Company = Profdetails.Company,
                        Designation = Profdetails.Designation,
                        WorkedFrom = Profdetails.WorkedFrom,
                        WorkedTill = Profdetails.WorkedTill

                    };
                    ProfessionalDetailsservice.UpdateUserProfDetails(UserId, Profdetail);
                    TempData["Success"] = UtilitiesClass.SuccessMessage;
                    return RedirectToAction("Profile", "Profile", new { area = "Alumini" });
                }
                ProfessionalDetail ProfDet = ProfessionalDetailsservice.Get(UserId);
                List<Graduation> _GraduationYears = new List<Graduation>();
                for (int i = 1970; i <= 2015; i++)
                    _GraduationYears.Add(new Graduation { GraduationYear = "" + i, GraduationYearId = i });
                ProfessionalDetails details = new ProfessionalDetails()
                {
                    Company = Profdetails.Company,
                    Designation = ProfDet.Designation,
                    WorkedFrom = ProfDet.WorkedFrom,
                    WorkedTill = ProfDet.WorkedTill,
                    GraduationYears = _GraduationYears
                };
                return View(details);
            }
            else
            {
                return RedirectToAction("Login", "Account", new { area = "" });
            }
        }