//
        // GET: /Manage/SetPassword
        public ActionResult ChangePersonalInformation()
        {
            ChangePersonalInformation lmd = new ChangePersonalInformation();
            DataSet ds = new DataSet();

            Connection.Connection con = new Connection.Connection();
            ds = con.UserData(User.Identity.GetUserId());
            if (ds.Tables[0].Rows.Count == 1)
            {
                DataRow dr = ds.Tables[0].Rows[0];
                lmd.Us_Name  = dr["Us_Name"].ToString();
                lmd.Us_LName = dr["Us_LName"].ToString();
                lmd.Us_Phone = dr["Us_Phone"].ToString();

                DateTimeFormatInfo format = new DateTimeFormatInfo();
                format.ShortDatePattern = "mm/dd/yyyy";
                lmd.Us_BirthDay         = Convert.ToDateTime(dr["Us_BirthDay"], format);

                lmd.Us_HomeAddress  = dr["Us_HomeAddress"].ToString();
                lmd.Us_WorkAddress  = dr["Us_WorkAddress"].ToString();
                lmd.City_Ct_Id      = Convert.ToInt16(dr["City_Ct_Id"]);
                lmd.SelectedState   = con.StateData(lmd.City_Ct_Id);
                lmd.SelectedCountry = con.CountryData(lmd.SelectedState);
                lmd.Countries       = con.GetListOfCountries();
                lmd.States          = con.GetListOfStates(lmd.SelectedCountry);
                lmd.Cities          = con.GetListOfCities(lmd.SelectedState);
            }
            return(View(lmd));
        }
        public Array FillStates(int Co_Id)
        {
            List <MySelectListItem>   States = new List <MySelectListItem>();
            ChangePersonalInformation lmd    = new ChangePersonalInformation();

            Connection.Connection con = new Connection.Connection();
            States = con.GetListOfStates(Co_Id);
            MySelectListItem[] StatesArr = States.ToArray();
            //int[] StatesArr={3,5};
            return(StatesArr);
        }
        public ActionResult ChangePersonalInformation(ChangePersonalInformation model)
        {
            Boolean TheResult = false;

            if (ModelState.IsValid)
            {
                Connection.Connection con = new Connection.Connection();
                TheResult = con.UpdateUserInformation(model, User.Identity.GetUserId());
            }
            if (TheResult == true)
            {
                return(RedirectToAction("Index", new { Message = ManageMessageId.UpdatePersonalInformation }));
            }
            else
            {
                return(View());
            }
        }