Example #1
0
        public ActionResult UpdateUserAddress(AddressIinformation Address)
        {
            string ReturnValue = "";
            int    RoleD       = Convert.ToInt32(Session["Role"]);

            Address.UserID = Session["UserID"].ToString();
            int rValue = _userData.UpdateUserAddress(Address, RoleD);

            return(Json(ReturnValue, JsonRequestBehavior.AllowGet));
        }
        public async Task <IHttpActionResult> UpdateUserAddress([FromBody] AddressIinformation Address)
        {
            HttpResponseMessage response = new HttpResponseMessage();

            try
            {
                Address.UserID = UserID;
                var retValue = await Task.Run(() => userService.UpdateUserAddress(Address, Role));

                return(Ok(retValue));
            }
            catch (Exception ex)
            {
                response = Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message);
                return(ResponseMessage(response));
            }
            finally
            {
            }
        }
Example #3
0
        public List <RegisterUser> GetTeamMemebrs()
        {
            List <RegisterUser> _userList     = new List <RegisterUser>();
            RegisterUser        _registerUser = new RegisterUser();
            User user = new User();
            PersonalInformation personalInfo = new PersonalInformation();
            AddressIinformation addInfo      = new AddressIinformation();
            BPInfo  bPinfo = new BPInfo();
            DataSet ds     = _userData.GetAllTeamMember(Session["BPID"].ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    user = new User
                    {
                        UserID     = row["UserID"].ToString(),
                        ActiveDate = Convert.ToDateTime(row["ActiveDate"]),
                        ExpireDate = Convert.ToDateTime(row["ExpireDate"]),
                        EmailID    = row["RegisterEmal"].ToString(),
                        IsActive   = Convert.ToBoolean(row["IsActive"]),
                    };
                    personalInfo = new PersonalInformation
                    {
                        FirstName      = row["FirstName"].ToString(),
                        AKA            = row["AKA"].ToString(),
                        TeamMemberRole = row["TeamMemberRole"].ToString(),
                        Email          = row["personalemail"].ToString(),
                        LastName       = row["LastName"].ToString()
                    };
                    _registerUser              = new RegisterUser();
                    _registerUser.User         = user;
                    _registerUser.PersonalInfo = personalInfo;
                    _userList.Add(_registerUser);
                }
            }
            return(_userList);
        }
Example #4
0
        public ActionResult UserProfile()
        {
            RegisterUser        registerUser        = new RegisterUser();
            User                user                = new User();
            PersonalInformation personalInformation = new PersonalInformation();
            AddressIinformation addressIinformation = new AddressIinformation();
            BPInfo              bPInfo              = new BPInfo();
            string              BPID                = Session["BPID"].ToString();
            string              UserID              = Session["UserID"].ToString();
            int RollID = Convert.ToInt32(Session["Role"]);

            List <SelectListItem> lstIndustry = new List <SelectListItem>();
            DataSet ds = _userData.GetIndustry();

            lstIndustry.Add(new SelectListItem {
                Text = "Select Industry", Value = "0"
            });
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    lstIndustry.Add(new SelectListItem {
                        Text = ds.Tables[0].Rows[i]["Industry"].ToString(), Value = ds.Tables[0].Rows[i]["Share"].ToString()
                    });
                }
            }

            ViewData["lstIndustry"] = lstIndustry;

            ViewData["Countrylst"]  = new AccountController().GetCountry();
            ViewData["Languagelst"] = new AccountController().GetLanguage();

            DataSet dsProfile = _userData.GetProfileDetails(BPID, UserID, RollID, "GetData");

            if (dsProfile.Tables[0].Rows.Count > 0)
            {
                addressIinformation.AddressID          = Convert.ToInt32(dsProfile.Tables[0].Rows[0]["AddressID"]);
                addressIinformation.CompName           = dsProfile.Tables[0].Rows[0]["CompName"].ToString();
                addressIinformation.CompName2          = dsProfile.Tables[0].Rows[0]["CompName2"].ToString();
                addressIinformation.Department         = dsProfile.Tables[0].Rows[0]["Department"].ToString();
                addressIinformation.Address1           = dsProfile.Tables[0].Rows[0]["Address1"].ToString();
                addressIinformation.Address2           = dsProfile.Tables[0].Rows[0]["Address2"].ToString();
                addressIinformation.POBox              = dsProfile.Tables[0].Rows[0]["POBox"].ToString();
                addressIinformation.City               = dsProfile.Tables[0].Rows[0]["City"].ToString();
                addressIinformation.State              = dsProfile.Tables[0].Rows[0]["State"].ToString();
                addressIinformation.Zip                = dsProfile.Tables[0].Rows[0]["Zip"].ToString();
                addressIinformation.CountryKey         = dsProfile.Tables[0].Rows[0]["CountryKey"].ToString();
                addressIinformation.Country            = dsProfile.Tables[0].Rows[0]["Country"].ToString();
                addressIinformation.Language           = dsProfile.Tables[0].Rows[0]["Language"].ToString();
                addressIinformation.Phone              = dsProfile.Tables[0].Rows[0]["Phone"].ToString();
                addressIinformation.WorkPhone          = dsProfile.Tables[0].Rows[0]["WorkPhone"].ToString();
                addressIinformation.MobilePhone        = dsProfile.Tables[0].Rows[0]["MobilePhone"].ToString();
                addressIinformation.Fax                = dsProfile.Tables[0].Rows[0]["Fax"].ToString();
                addressIinformation.TimeZone           = dsProfile.Tables[0].Rows[0]["TimeZone"].ToString();
                addressIinformation.Location           = dsProfile.Tables[0].Rows[0]["Location"].ToString();
                addressIinformation.DistrictPostalCode = dsProfile.Tables[0].Rows[0]["DistrictPostalCode"].ToString();
                addressIinformation.county             = dsProfile.Tables[0].Rows[0]["County"].ToString();


                if (RollID == 2 || RollID == 6)
                {
                    personalInformation.PersonalID   = Convert.ToInt32(dsProfile.Tables[0].Rows[0]["PersonalID"]);
                    personalInformation.BirthCountry = dsProfile.Tables[0].Rows[0]["BirthCountry"].ToString();
                    personalInformation.Country      = dsProfile.Tables[0].Rows[0]["pCountry"].ToString();
                    personalInformation.DateOfBorn   = Convert.ToDateTime(dsProfile.Tables[0].Rows[0]["DateOfBorn"]);
                    personalInformation.Email        = dsProfile.Tables[0].Rows[0]["Email"].ToString();
                    personalInformation.FirstName    = dsProfile.Tables[0].Rows[0]["FirstName"].ToString();
                    personalInformation.LastName     = dsProfile.Tables[0].Rows[0]["LastName"].ToString();
                    personalInformation.AKA          = dsProfile.Tables[0].Rows[0]["AKA"].ToString();
                    personalInformation.Language     = dsProfile.Tables[0].Rows[0]["pLanguage"].ToString();
                    personalInformation.LastName2    = dsProfile.Tables[0].Rows[0]["LastName2"].ToString();
                    personalInformation.Website      = dsProfile.Tables[0].Rows[0]["Website"].ToString();
                    personalInformation.Profession   = dsProfile.Tables[0].Rows[0]["Profession"].ToString();
                    personalInformation.Title        = dsProfile.Tables[0].Rows[0]["Title"].ToString().Trim();
                    personalInformation.MiddleName   = dsProfile.Tables[0].Rows[0]["MiddleName"].ToString();
                    personalInformation.Name2        = dsProfile.Tables[0].Rows[0]["Name2"].ToString();
                    personalInformation.Gender       = dsProfile.Tables[0].Rows[0]["Gender"].ToString().Trim();
                }
                else if (RollID == 5)
                {
                    bPInfo.AddressID        = Convert.ToInt32(dsProfile.Tables[0].Rows[0]["AddressID"]);
                    bPInfo.Country          = dsProfile.Tables[0].Rows[0]["bpCountry"].ToString();
                    bPInfo.ContactNameFirst = dsProfile.Tables[0].Rows[0]["bpName"].ToString();
                    bPInfo.City             = dsProfile.Tables[0].Rows[0]["bpCity"].ToString();
                    bPInfo.State            = dsProfile.Tables[0].Rows[0]["bpState"].ToString();
                    bPInfo.Fax             = dsProfile.Tables[0].Rows[0]["bpFax"].ToString();
                    bPInfo.Zip             = dsProfile.Tables[0].Rows[0]["bpZip"].ToString();
                    bPInfo.Partner         = dsProfile.Tables[0].Rows[0]["Partner"].ToString();
                    bPInfo.Language        = dsProfile.Tables[0].Rows[0]["bpLanguage"].ToString();
                    bPInfo.TollFreePhone   = dsProfile.Tables[0].Rows[0]["TollFreeNo"].ToString();
                    bPInfo.ContactNameLast = dsProfile.Tables[0].Rows[0]["bpLastName"].ToString();
                    bPInfo.CompName        = dsProfile.Tables[0].Rows[0]["bpCompName"].ToString();
                    bPInfo.CompanyEIN      = dsProfile.Tables[0].Rows[0]["CompanyEIN"].ToString();
                    bPInfo.CompanyDate     = Convert.ToDateTime(dsProfile.Tables[0].Rows[0]["CompanyDate"]);
                    bPInfo.Email           = dsProfile.Tables[0].Rows[0]["bpEmail"].ToString();
                    bPInfo.Department      = dsProfile.Tables[0].Rows[0]["bpDepartment"].ToString();
                    bPInfo.Website         = dsProfile.Tables[0].Rows[0]["bpWebsite"].ToString();
                }
            }
            registerUser.User         = user;
            registerUser.PersonalInfo = personalInformation;
            registerUser.AddInfo      = addressIinformation;
            registerUser.BPinfo       = bPInfo;

            if (TempData["expiredate"] == null)
            {
                TempData["expiredate"] = Convert.ToDateTime(dsProfile.Tables[0].Rows[0]["ExpireDate"]);
            }
            else if (Convert.ToDateTime(TempData["expiredate"]) != Convert.ToDateTime(dsProfile.Tables[0].Rows[0]["ExpireDate"]))
            {
                TempData["expiredate"] = Convert.ToDateTime(dsProfile.Tables[0].Rows[0]["ExpireDate"]);
            }



            ViewBag.ExpireDate = Convert.ToDateTime(TempData["expiredate"]).ToShortDateString();

            TempData.Keep();
            return(View(registerUser));
        }
Example #5
0
        public RegisterUser UserProfile(string BPID, string UserID, int RollID)
        {
            RegisterUser        registerUser        = new RegisterUser();
            User                user                = new User();
            PersonalInformation personalInformation = new PersonalInformation();
            AddressIinformation addressIinformation = new AddressIinformation();
            BPInfo              bPInfo              = new BPInfo();

            DataSet dsProfile = _userData.GetProfileDetails(BPID, UserID, RollID, "GetData");

            if (dsProfile.Tables[0].Rows.Count > 0)
            {
                addressIinformation.AddressID          = Convert.ToInt32(dsProfile.Tables[0].Rows[0]["AddressID"]);
                addressIinformation.CompName           = dsProfile.Tables[0].Rows[0]["CompName"].ToString();
                addressIinformation.CompName2          = dsProfile.Tables[0].Rows[0]["CompName2"].ToString();
                addressIinformation.Department         = dsProfile.Tables[0].Rows[0]["Department"].ToString();
                addressIinformation.Address1           = dsProfile.Tables[0].Rows[0]["Address1"].ToString();
                addressIinformation.Address2           = dsProfile.Tables[0].Rows[0]["Address2"].ToString();
                addressIinformation.POBox              = dsProfile.Tables[0].Rows[0]["POBox"].ToString();
                addressIinformation.City               = dsProfile.Tables[0].Rows[0]["City"].ToString();
                addressIinformation.State              = dsProfile.Tables[0].Rows[0]["State"].ToString();
                addressIinformation.Zip                = dsProfile.Tables[0].Rows[0]["Zip"].ToString();
                addressIinformation.CountryKey         = dsProfile.Tables[0].Rows[0]["CountryKey"].ToString();
                addressIinformation.Country            = dsProfile.Tables[0].Rows[0]["Country"].ToString();
                addressIinformation.Language           = dsProfile.Tables[0].Rows[0]["Language"].ToString();
                addressIinformation.Phone              = dsProfile.Tables[0].Rows[0]["Phone"].ToString();
                addressIinformation.WorkPhone          = dsProfile.Tables[0].Rows[0]["WorkPhone"].ToString();
                addressIinformation.MobilePhone        = dsProfile.Tables[0].Rows[0]["MobilePhone"].ToString();
                addressIinformation.Fax                = dsProfile.Tables[0].Rows[0]["Fax"].ToString();
                addressIinformation.TimeZone           = dsProfile.Tables[0].Rows[0]["TimeZone"].ToString();
                addressIinformation.Location           = dsProfile.Tables[0].Rows[0]["Location"].ToString();
                addressIinformation.DistrictPostalCode = dsProfile.Tables[0].Rows[0]["DistrictPostalCode"].ToString();
                addressIinformation.county             = dsProfile.Tables[0].Rows[0]["County"].ToString();


                if (RollID == 2 || RollID == 6)
                {
                    personalInformation.PersonalID   = Convert.ToInt32(dsProfile.Tables[0].Rows[0]["PersonalID"]);
                    personalInformation.BirthCountry = dsProfile.Tables[0].Rows[0]["BirthCountry"].ToString();
                    personalInformation.Country      = dsProfile.Tables[0].Rows[0]["pCountry"].ToString();
                    personalInformation.DateOfBorn   = Convert.ToDateTime(dsProfile.Tables[0].Rows[0]["DateOfBorn"]);
                    personalInformation.Email        = dsProfile.Tables[0].Rows[0]["Email"].ToString();
                    personalInformation.FirstName    = dsProfile.Tables[0].Rows[0]["FirstName"].ToString();
                    personalInformation.LastName     = dsProfile.Tables[0].Rows[0]["LastName"].ToString();
                    personalInformation.AKA          = dsProfile.Tables[0].Rows[0]["AKA"].ToString();
                    personalInformation.Language     = dsProfile.Tables[0].Rows[0]["pLanguage"].ToString();
                    personalInformation.LastName2    = dsProfile.Tables[0].Rows[0]["LastName2"].ToString();
                    personalInformation.Website      = dsProfile.Tables[0].Rows[0]["Website"].ToString();
                    personalInformation.Profession   = dsProfile.Tables[0].Rows[0]["Profession"].ToString();
                    personalInformation.Title        = dsProfile.Tables[0].Rows[0]["Title"].ToString().Trim();
                    personalInformation.MiddleName   = dsProfile.Tables[0].Rows[0]["MiddleName"].ToString();
                    personalInformation.Name2        = dsProfile.Tables[0].Rows[0]["Name2"].ToString();
                    personalInformation.Gender       = dsProfile.Tables[0].Rows[0]["Gender"].ToString().Trim();
                }
                else if (RollID == 5)
                {
                    bPInfo.AddressID        = Convert.ToInt32(dsProfile.Tables[0].Rows[0]["AddressID"]);
                    bPInfo.Country          = dsProfile.Tables[0].Rows[0]["bpCountry"].ToString();
                    bPInfo.ContactNameFirst = dsProfile.Tables[0].Rows[0]["bpName"].ToString();
                    bPInfo.City             = dsProfile.Tables[0].Rows[0]["bpCity"].ToString();
                    bPInfo.State            = dsProfile.Tables[0].Rows[0]["bpState"].ToString();
                    bPInfo.Fax             = dsProfile.Tables[0].Rows[0]["bpFax"].ToString();
                    bPInfo.Zip             = dsProfile.Tables[0].Rows[0]["bpZip"].ToString();
                    bPInfo.Partner         = dsProfile.Tables[0].Rows[0]["Partner"].ToString();
                    bPInfo.Language        = dsProfile.Tables[0].Rows[0]["bpLanguage"].ToString();
                    bPInfo.TollFreePhone   = dsProfile.Tables[0].Rows[0]["TollFreeNo"].ToString();
                    bPInfo.ContactNameLast = dsProfile.Tables[0].Rows[0]["bpLastName"].ToString();
                    bPInfo.CompName        = dsProfile.Tables[0].Rows[0]["bpCompName"].ToString();
                    bPInfo.CompanyEIN      = dsProfile.Tables[0].Rows[0]["CompanyEIN"].ToString();
                    bPInfo.CompanyDate     = Convert.ToDateTime(dsProfile.Tables[0].Rows[0]["CompanyDate"]);
                    bPInfo.Email           = dsProfile.Tables[0].Rows[0]["bpEmail"].ToString();
                    bPInfo.Department      = dsProfile.Tables[0].Rows[0]["bpDepartment"].ToString();
                    bPInfo.Website         = dsProfile.Tables[0].Rows[0]["bpWebsite"].ToString();
                }
            }
            registerUser.User         = user;
            registerUser.PersonalInfo = personalInformation;
            registerUser.AddInfo      = addressIinformation;
            registerUser.BPinfo       = bPInfo;

            return(registerUser);
        }
Example #6
0
 public int UpdateUserAddress(AddressIinformation Address, int RoleID)
 {
     return(_userData.UpdateUserAddress(Address, RoleID));
 }