public void AddAppAccountInfo(AppAccountInfo appAccountInfo)
 {
     if (appAccountInfo != null)
     {
         DynamicArray<AppAccountInfo> dynamicArray = new DynamicArray<AppAccountInfo>();
         AppAccountInfos = dynamicArray.AddToArray(AppAccountInfos, appAccountInfo);
     }
 }
        public UserAccountSummary GetUserAccountSummary(string userID)
        {
            UserAccountSummary summary = null;
            if (userID != null)
            {
                string sql = "select * from [tb_AccountInfo] where [UserID]=@userid";
                SqlCommand sc = new SqlCommand(sql);
                sc.Parameters.AddWithValue("@userid", userID);
                DataTable dtinfo = da.GetDataTable(sql, sc);
                if (dtinfo != null && dtinfo.Rows != null)
                {
                    summary = new UserAccountSummary();
                    summary.UserID = userID;

                    foreach (DataRow row in dtinfo.Rows)
                    {
                        DataRowWrapper rowWrapper = new DataRowWrapper(row);

                        AppAccountInfo appAccountInfo = new AppAccountInfo();
                        appAccountInfo.ApplicationID = rowWrapper.GetColumnValueAsString("ApplicationID");

                        appAccountInfo.Locked = rowWrapper.GetColumnValueAsBool("Locked");
                        appAccountInfo.ExpiryTime = dtinfo.Rows[0]["ExpiryTime"].ToString() != "" ? Convert.ToDateTime(dtinfo.Rows[0]["ExpiryTime"].ToString()) : Convert.ToDateTime("1900-01-01");
                        appAccountInfo.ExpiryTimeSpecified = (appAccountInfo.ExpiryTime.ToString("yyyy-MM-dd") == "1900-01-01") ? false : true;

                        summary.AddAppAccountInfo(appAccountInfo);
                    }
                }
            }
            return summary;
        }