Ejemplo n.º 1
0
        //ContactUs
        public ActionResult UserProfile(UserProfileModal userProfile)
        {
            int id = Convert.ToInt32(Session["Id"].ToString());

            using (projectEntities1 db = new projectEntities1())
            {
                MembersData usr = db.MembersDatas.Where(u => u.Id == id).FirstOrDefault();
                {
                    userProfile.FirstName = usr.FirstName;
                    userProfile.LastName  = usr.LastName;
                    userProfile.EmailId   = usr.EmailId;

                    return(View(userProfile));
                }
            }
        }
Ejemplo n.º 2
0
        public ActionResult UserProfile(UserProfileModal userProfile, HttpPostedFileBase dp)
        {
            if (Session["Id"] != null)
            {
                int id = Convert.ToInt32(Session["Id"].ToString());
                using (projectEntities1 db = new projectEntities1())
                {
                    MembersData usr = db.MembersDatas.Where(u => u.Id == id).FirstOrDefault();
                    {
                        string fileName = Path.GetFileName(dp.FileName);
                        userProfile.uploaddp = "~/images/" + fileName;
                        fileName             = Path.Combine(Server.MapPath("~/images/"), fileName);
                        dp.SaveAs(fileName);

                        usr.AddLine1           = userProfile.add1;
                        usr.Addline2           = userProfile.add2;
                        usr.City               = userProfile.city;
                        usr.Collage            = userProfile.collage;
                        usr.Country            = userProfile.country;
                        usr.State              = userProfile.state;
                        usr.University         = userProfile.university;
                        usr.ZipCode            = userProfile.zipcode;
                        usr.DOB                = userProfile.bdate;
                        usr.PhoneNo            = userProfile.phone;
                        usr.IsDetailsSubmitted = true;
                        usr.CPassword          = "******";

                        usr.Gender = "Male";

                        usr.ProfilePicture = userProfile.uploaddp;
                        db.SaveChanges();
                        return(View());
                    }
                }
            }
            else
            {
                return(View());
            }
        }
        internal UserProfileModal GetProfileData(string uidNo, string rollNo)
        {
            UserProfileModal userProfileModal = new UserProfileModal();

            var genInfo = _dbConnection.GetModelDetails(RawSQL.GetProfileData(uidNo, rollNo)).AsEnumerable().FirstOrDefault();

            var branchInfo = _dbConnection.GetModelDetails(RawSQL.GetProfileBrInfo(Convert.ToDouble(rollNo))).AsEnumerable().FirstOrDefault();

            var sdfsd       = genInfo.Table;
            var profileData = new ProfileInfo()
            {
                Title         = genInfo?.Field <string>("Title"),
                FullName      = genInfo?.Field <string>("Name_Full"),
                DateOfBirth   = genInfo?.Field <DateTime?>("Date_Birth"),
                Gender        = genInfo?.Field <string>("Gender"),
                Caste         = genInfo?.Field <string>("Caste"),
                MaritalStatus = Convert.ToString(genInfo?.Field <Double?>("Marital_Status")) == "0" ? "Married"
                                : Convert.ToString(genInfo?.Field <Double?>("Marital_Status")) == "1" ? "Single"
                                : Convert.ToString(genInfo?.Field <Double?>("Marital_Status")) == "3" ? "Widowed"
                                : Convert.ToString(genInfo?.Field <Double?>("Marital_Status")) == "4" ? "Divorced"
                                : Convert.ToString(genInfo?.Field <Double?>("Marital_Status")) == "5" ? "Other"
                                : "Other",
                Nationality = genInfo?.Field <string>("Nationality") == "I" ? "Indian" : "Other",
                AadharNo    = genInfo.Field <string>("AadharNo"),
                PanNo       = genInfo.Field <string>("PanCardNo")
            };

            var contactData = new ContactInfo()
            {
                ResidenceAddr = genInfo?.Field <string>("Add1") +
                                genInfo?.Field <string>("Add2") +
                                genInfo?.Field <string>("Add3"),
                City               = genInfo?.Field <string>("City"),
                Pincode            = genInfo?.Field <string>("Pin_cd"),
                MobileNo1          = genInfo?.Field <string>("Mobile"),
                MobileNo2          = genInfo?.Field <string>("Mobile1"),
                EmergencyContact   = genInfo?.Field <string>("EmergencyContact"),
                EmergencyContactNo = genInfo?.Field <string>("EmergencyContactNo"),
                Email1             = genInfo?.Field <string>("Email1"),
                Email2             = genInfo?.Field <string>("Email2")
            };

            var occupationData = new CompanyInfo
            {
                OrgName     = genInfo?.Field <string>("Organization"),
                OrgAddress  = genInfo?.Field <string>("Place"),
                Designation = genInfo?.Field <string>("Designation"),
                Occupation  = genInfo?.Field <string>("Occupation"),
                OfficePh1   = genInfo?.Field <string>("Off_ph1"),
                OfficePh2   = genInfo?.Field <string>("Off_ph2")
            };

            var qualificationData = new QualificationInfo
            {
                Qualification = genInfo?.Field <string>("Qualification")
            };

            var personBrInfo = new PersonBrInfo
            {
                RollNo     = Convert.ToInt32(genInfo?.Field <Double?>("Roll_NO")),
                UidNo      = genInfo?.Field <string>("UID_No"),
                BrTitle    = genInfo?.Field <string>("Title_1"),
                GridCoord  = genInfo?.Field <string>("Grid_Coord"),
                DateOfIni1 = branchInfo?.Field <DateTime?>("DOI_1"),
                DateOfIni2 = branchInfo?.Field <DateTime?>("DOI_2")
            };

            userProfileModal.ProfileList       = profileData;
            userProfileModal.ContactInfo       = contactData;
            userProfileModal.CompanyInfo       = occupationData;
            userProfileModal.QualificationInfo = qualificationData;
            userProfileModal.PersonBrInfo      = personBrInfo;
            return(userProfileModal);
        }