Пример #1
0
        public int SaveProfile(long AccountID, string FirstName, string LastName, string PrimaryEmail, string SecondaryEmail, string NewPassword)
        {
            ProfileModel objProfile = new ProfileModel();
            UsersBE UserEntities = new UsersBE();
            string Password;
            UserEntities = objProfile.GetAccountDetailsByAccountID(AccountID);
            string UserName = UserEntities.UserName;
            if (!string.IsNullOrEmpty(NewPassword))
            {
                Password = Cryptography.Cryptography.Encrypt(NewPassword);
            }
            else
            {
                Password = UserEntities.Password;
            }
            string Cellphone = UserEntities.CellPhone;
            string VerificationGuid = UserEntities.VerificationGuid.ToString();
            int  CarrierProviderListID = UserEntities.CarrierProviderListID;
            long FacebookUserID = UserEntities.FacebookUserID;
            bool IsFacebookID = UserEntities.IsFacebookID;

            int ID = objRegistrationDAL.RegisterUserWithOutFacebookDAL(AccountID, UserName, Password, FirstName, LastName, PrimaryEmail, SecondaryEmail, Cellphone, VerificationGuid, CarrierProviderListID, FacebookUserID, IsFacebookID);

            return ID;
        }
Пример #2
0
 public ActionResult EditProfile()
 {
     long AccountID = 0;
     if (Request.Cookies["ID"] != null)
     {
         AccountID = Convert.ToInt64(Request.Cookies["ID"].Value.ToString());
     }
     ProfileModel objProfile = new ProfileModel();
     UsersBE UserEntities = new UsersBE();
     UserEntities = objProfile.GetAccountDetailsByAccountID(AccountID);
     return View(UserEntities);
 }
Пример #3
0
        public UsersBE GetAccountDetailsByAccountID(long AccountID)
        {
            UsersBE UserEntities = new UsersBE();
            try
            {
                DbCommand objSelectCommand = objDB.GetStoredProcCommand("CL_GetAccountDetailByAccountID");
                objDB.AddInParameter(objSelectCommand, "@AccountID", DbType.Int64, AccountID);
                objDS = objDB.ExecuteDataSet(objSelectCommand);
                IDataReader drList = objDB.ExecuteReader(objSelectCommand);
                while (drList.Read())
                {
                    if (!drList.IsDBNull(0))
                        UserEntities.AccountID  = drList.GetInt64(0);

                    if (!drList.IsDBNull(1))
                        UserEntities.FirstName  = drList.GetString(1);

                    if (!drList.IsDBNull(2))
                        UserEntities.LastName = drList.GetString(2);

                    if (!drList.IsDBNull(3))
                        UserEntities.PrimaryEmail  = drList.GetString(3);

                    if (!drList.IsDBNull(4))
                        UserEntities.SecondaryEmail  = drList.GetString(4);

                    if (!drList.IsDBNull(5))
                        UserEntities.Password  = drList.GetString(5);

                    if (!drList.IsDBNull(6))
                        UserEntities.ProfileImage = drList.GetString(6);

                    if (!drList.IsDBNull(7))
                        UserEntities.UserName  = drList.GetString (7);

                    if (!drList.IsDBNull(8))
                        UserEntities.CellPhone  = drList.GetString(8);

                    if (!drList.IsDBNull(9))
                        UserEntities.IsVerified  = drList.GetBoolean (9);

                    if (!drList.IsDBNull(10))
                        UserEntities.VerificationGuid  = drList.GetGuid (10);

                    if (!drList.IsDBNull(11))
                        UserEntities.CreateDate  = drList.GetDateTime (11);

                    if (!drList.IsDBNull(12))
                        UserEntities.CarrierID  = drList.GetInt32 (12);

                    if (!drList.IsDBNull(13))
                        UserEntities.FacebookUserID  = drList.GetInt64(13);

                    if (!drList.IsDBNull(14))
                        UserEntities.IsFacebookID = drList.GetBoolean(14);

                    if (!drList.IsDBNull(15))
                        UserEntities.CarrierProviderListID  = drList.GetInt32(15);

                    if (!drList.IsDBNull(16))
                        UserEntities.IsAdmin = drList.GetBoolean(16);

                    if (!drList.IsDBNull(17))
                        UserEntities.IsFirstTime = drList.GetBoolean(17);

                }

                if (!drList.IsClosed)
                    drList.Close();

                return UserEntities;
            }
            catch (Exception ex)
            {
                return UserEntities;
            }
        }