Beispiel #1
0
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     vm = (DataContext as profileViewModel);
     vm.events.Subscribe(this);
     passwordTB.Password  = vm.initialPP.password;
     password2TB.Password = vm.initialPP.password;
 }
Beispiel #2
0
        public ActionResult skillEnquiry(profileViewModel model, string usID)
        {
            int uID = Convert.ToInt16(usID);


            tbClient client = db.tbClients.Where(c => c.userID.Equals(uID)).Single();

            model.tbSkill.devID = client.tbDevelopers.FirstOrDefault().devID;

            db.tbSkills.Add(model.tbSkill);
            db.SaveChanges();
            int skID   = model.tbSkill.skillID;
            var action = from dev in db.tbClients where dev.userID == uID select dev;

            string actionUpdated = "skillEnquiry";

            foreach (tbClient d in action)
            {
                d.actionCont  = "quizVerify";
                actionUpdated = d.actionCont;
            }
            db.SaveChanges();
            TempData["skill"] = skID;

            return(RedirectToAction(actionUpdated, "Developer", new { id = skID }));
        }
Beispiel #3
0
        public ActionResult viewProfile(string id)
        {
            int uID = Convert.ToInt16(id);
            profileViewModel model = new profileViewModel();

            model.tbUser   = db.tbUsers.Where(u => u.userID == uID).FirstOrDefault();
            model.tbClient = db.tbClients.Where(c => c.userID == uID).FirstOrDefault();

            return(View(model));
        }
Beispiel #4
0
        public ActionResult viewProfile(string id)
        {
            int ID = Convert.ToInt16(id);
            profileViewModel model  = new profileViewModel();
            tbClient         client = db.tbClients.Where(u => u.userID.Equals(ID)).FirstOrDefault();

            model.tbDeveloper  = client.tbDevelopers.FirstOrDefault();
            model.tbEducations = client.tbEducations.ToList();
            model.tbSkills     = client.tbDevelopers.FirstOrDefault().tbSkills.ToList();
            model.tbUser       = client.tbUser;
            return(View(model));
        }
Beispiel #5
0
        public ActionResult profileDev()
        {
            var id = Convert.ToInt32(Session["devID"]);

            tbUserCredential user   = db.tbUserCredentials.Where(u => u.userID.Equals(id)).FirstOrDefault();
            tbClient         client = db.tbClients.Where(u => u.userID.Equals(user.userID)).FirstOrDefault();
            profileViewModel model  = new profileViewModel();

            model.tbDeveloper = client.tbDevelopers.FirstOrDefault();
            model.tbSkills    = client.tbDevelopers.FirstOrDefault().tbSkills.ToList();
            model.tbUser      = client.tbUser;
            return(View(model));
        }
Beispiel #6
0
        public async Task <ActionResult> edprofile(string ids, [Bind(Exclude = "ID,TrackingID,Email")] profileViewModel apuser, FormCollection f)
        {
            if (ids == null)
            {
                return(HttpNotFound("Error: Requested user not found!"));
            }
            string s = System.Configuration.ConfigurationManager.AppSettings["MaxLevel"];

            ids = ids.Replace("$25", "/");
            ids = ids.Replace("$24", "+");
            string DecryptId = Cryptoclass.DecryptStringAES(ids, s);
            var    usr       = UserManager.FindById(DecryptId);

            if (ModelState.IsValid)
            {
                var A_O_S = f["other_Profession"];
                if (!string.IsNullOrEmpty(f["subCat1"]))
                {
                    int subcatId1 = Convert.ToInt32(f["subCat1"]);
                    var sbcat1    = await db.SubCategory1.FindAsync(subcatId1);

                    A_O_S = (A_O_S != "") ? A_O_S + ", " + sbcat1.SubCat1Name : sbcat1.SubCat1Name;
                }
                if (!string.IsNullOrEmpty(f["subCat2"]))
                {
                    int subcatId2 = Convert.ToInt32(f["subCat2"]);
                    var sbcat2    = await db.SubCategory2.FindAsync(subcatId2);

                    A_O_S = (A_O_S != "") ? A_O_S + ", " + sbcat2.SubCat2name : sbcat2.SubCat2name;
                }
                //string Username = model.UserName;
                int profVal = (!string.IsNullOrEmpty(f["Profession"])) ? Convert.ToInt32(f["Profession"]) : 0;
                var prof    = (profVal != 0) ? await db.Profession.FindAsync(profVal) : null;

                if (f["Country"] != "")
                {
                    int conid = Convert.ToInt32(f["Country"]); var con3 = await db.country.FindAsync(conid); usr.Nationality = con3.CountryName;
                }
                if (apuser.state != null)
                {
                    int stid = Convert.ToInt32(apuser.state); var st = await db.State.FindAsync(stid); usr.State = st.StateName;
                }
                usr.City                    = apuser.city;
                usr.Address                 = apuser.Address;
                usr.PhoneNumber             = apuser.phone;
                usr.backgroundinfo          = (f["summary"] != "") ? f["summary"] : usr.backgroundinfo;
                usr.facebookUrl             = (f["fbUrl"] != "") ? f["fbUrl"] : usr.facebookUrl;
                usr.twitterUrl              = (f["twUrl"] != "") ? f["twUrl"] : usr.twitterUrl;
                usr.linkedinUrl             = (f["lnUrl"] != "") ? f["lnUrl"] : usr.linkedinUrl;
                usr.Health_Service_Provider = f["HSP"];
                usr.Profession              = (f["HSP"] == "Yes" && prof != null) ? prof.Nomenclature : "Information_Seeker";
                usr.AreaOfSpecialization    = A_O_S;
                UserManager.Update(usr);
                TempData["Success"] = "Your Details has been Updated Successfully";
                String EncryptId = Cryptoclass.EncryptStringAES(usr.UserName, s);
                EncryptId = EncryptId.Replace("/", "$25");
                EncryptId = EncryptId.Replace("+", "$24");
                return(RedirectToAction("Profiles", new { ids = EncryptId }));
            }
            String EId = Cryptoclass.EncryptStringAES(usr.Id, s);

            EId = EId.Replace("/", "$25");
            EId = EId.Replace("+", "$24");
            ids = EId;
            TempData["error"] = "Check that the Phone Number field is correclty typed PHONE NUMBR FORMAT";
            ModelState.AddModelError("", "validate the error field");
            return(RedirectToAction("profiles", new { ids = EId }));
        }