Beispiel #1
0
        public bool pb__register_user(wcl_db_adapter.cDBMySQLAdapter c_adapter, ref bool b_no_valid_data)
        {
            bool b_rc       = true;
            bool b_has_data = true;

            try
            {
                this.m_c_db = c_adapter;

                b_rc = b_rc && this.pr__check_data(ref b_has_data);

                if (b_has_data)
                {
                    b_rc = b_rc && this.pr__check_if_there_is_another_user_in_db_yet(ref b_no_valid_data);
                }
                else
                {
                    b_no_valid_data = true;
                }

                b_rc = b_rc && this.pr__register_result(b_no_valid_data, b_rc);
            }
            catch (Exception)
            {
                b_rc = false;
                System.Diagnostics.Debugger.Break();
            }
            finally { }
            return(b_rc);
        }
        public cPanel(wcl_db_adapter.cDBMySQLAdapter db_adapter)
        {
            bool b_rc = true;

            try
            {
                //System.Diagnostics.Debugger.Break();
                b_rc = b_rc && this.pr__init_db_adapter(db_adapter);
            }
            catch (Exception)
            {
                b_rc = false;
                System.Diagnostics.Debugger.Break();
            }
            finally { }
        }
        private bool pr__init_db_adapter()
        {
            bool b_rc = true;

            try
            {
                //System.Diagnostics.Debugger.Break();
                this.m_c_db = new cDBMySQLAdapter();
                this.m_c_db.p_i_timeout_seconds = cConstants.m_i_timeout;
            }
            catch (Exception)
            {
                b_rc = false;
                System.Diagnostics.Debugger.Break();
            }
            finally { }
            return(b_rc);
        }
        public cPanelManager(string s_connection_string)
        {
            bool b_rc = true;

            try
            {
                //System.Diagnostics.Debugger.Break();
                this.m_c_db = new cDBMySQLAdapter(s_connection_string);
                this.m_c_db.p_i_timeout_seconds = cConstants.m_i_timeout;
                //b_rc = b_rc && this.pr__init_lst_panels();
                b_rc = b_rc && this.pr__init_lst(ref this.m_lst_c_panels);
            }
            catch (Exception)
            {
                b_rc = false;
                System.Diagnostics.Debugger.Break();
            }
            finally { }
        }
        public bool pb__is_user_valid(wcl_db_adapter.cDBMySQLAdapter c_adapter, ref bool b_is_valid)
        {
            bool   b_rc = true;
            string s_validation_query             = String.Empty;
            List <wcl_db_adapter.cDBRow> lst_rows = null;

            try
            {
                this.m_c_db = c_adapter;

                s_validation_query = "SELECT * FROM " + cConstants.m_s_table__users
                                     + " WHERE " + cConstants.m_s_field__user_email + " = " + this.m_c_db.pb__get_string(this.m_s_user_email)
                                     + " AND " + cConstants.m_s_field__user_password + " = " + this.m_c_db.pb__get_string(this.m_s_user_password);

                b_rc = b_rc && this.m_c_db.pb__query(s_validation_query, ref lst_rows);

                if (lst_rows != null && lst_rows.Count == 1)
                {
                    b_is_valid = true;
                    this.m_b_user_login_error = false;
                    b_rc = b_rc && this.pr__read_user(lst_rows);
                }
                else
                {
                    b_is_valid = false;
                    this.m_b_user_login_error = true;
                }
            }
            catch (Exception)
            {
                b_rc = false;
                System.Diagnostics.Debugger.Break();
            }
            finally { }
            return(b_rc);
        }