Example #1
0
        private bool RefreshCurrentRecord()
        {
            EmptyControls();

            Abstracts.Abstract_tblCategory oAbstract_tblCategory = null;
            switch (this.lastKnownConnectionType)
            {
            case OlymarsDemo.DataClasses.ConnectionType.ConnectionString:
                oAbstract_tblCategory = new Abstracts.Abstract_tblCategory(this.connectionString);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlConnection:
                oAbstract_tblCategory = new Abstracts.Abstract_tblCategory(this.sqlConnection);
                break;
            }

            if (oAbstract_tblCategory.Refresh(this.currentID))
            {
                this.IgnoreChanges = true;

                if (!oAbstract_tblCategory.Col_Cat_StrName.IsNull)
                {
                    Control_Cat_StrName.Text = oAbstract_tblCategory.Col_Cat_StrName.Value.ToString();
                }


                this.IgnoreChanges = false;
                return(true);
            }

            else
            {
                MessageBox.Show("The record does not exist any more !", "Record not found", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return(false);
            }
        }