private void Reset()
 {
     TxtBookName.Clear();
     TxtBookAuthor.Clear();
     TxtBookPrice.ResetText();
     TxtBookQuantity.Clear();
     DtpPurchaseDate.ResetText();
 }
示例#2
0
        private void ClearData()
        {
            if (isNew == false && isUpdate == false)
            {
                TxtBookID.DataBindings.Clear();
                TxtBookName.DataBindings.Clear();
                TxtBookStatus.DataBindings.Clear();
                TxtBookPrice.DataBindings.Clear();
                TxtBookQuantity.DataBindings.Clear();
                TxtAuthorName.DataBindings.Clear();

                TxtBookID.Clear();
                TxtBookName.Clear();
                TxtBookStatus.Clear();
                TxtBookPrice.Clear();
                TxtBookQuantity.Clear();
                TxtAuthorName.Clear();
            }
            //else if (isUpdate == true && isNew == false)
            else if (isUpdate == true)
            {
                TxtBookName.DataBindings.Clear();
                TxtBookStatus.DataBindings.Clear();
                TxtBookPrice.DataBindings.Clear();
                TxtBookQuantity.DataBindings.Clear();
                TxtAuthorName.DataBindings.Clear();

                TxtBookName.Clear();
                TxtBookStatus.Clear();
                TxtBookPrice.Clear();
                TxtBookQuantity.Clear();
                TxtAuthorName.Clear();
            }
            //else if (isUpdate == false && isNew == true)
            else if (isNew == true)
            {
                TxtBookID.DataBindings.Clear();
                TxtBookName.DataBindings.Clear();
                TxtBookStatus.DataBindings.Clear();
                TxtBookPrice.DataBindings.Clear();
                TxtBookQuantity.DataBindings.Clear();
                TxtAuthorName.DataBindings.Clear();

                TxtBookID.Clear();
                TxtBookName.Clear();
                TxtBookStatus.Clear();
                TxtBookPrice.Clear();
                TxtBookQuantity.Clear();
                TxtAuthorName.Clear();
            }
        }