Example #1
0
        void itemWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (AutoPartId == 0)
            {
                ClientHelper.ShowSuccessMessage("Auto part successfully added.");
            }
            else
            {
                ClientHelper.ShowSuccessMessage("Auto part details successfully updated.");
            }

            ClearForm();
            LoadPartNames();

            if (AutoPartUpdated != null)
            {
                AutoPartUpdated(new object(), new EventArgs());
            }

            AutoPartTextbox.Focus();

            LoadImage.Visible = false;

            SaveButton.Enabled  = true;
            ClearButton.Enabled = true;
        }
Example #2
0
 private void ClearForm()
 {
     if (AutoPartId == 0)
     {
         AutoPartTextbox.Clear();
         DescriptionTextbox.Clear();
         MakeTextbox.Clear();
         ModelTextbox.Clear();
         brandBindingSource.Position = -1;
         BrandDropdown.SelectedIndex = -1;
         SellingPriceTextbox.Text    = "0.00";
         SellingPrice2Textbox.Text   = "0.00";
         PurchasePriceTextbox.Text   = "0.00";
         ReorderTextbox.Text         = "0";
         InitialQtyTextbox.Text      = "0";
         UnitTextbox.Clear();
         PartNumberTextbox.Clear();
         SizeTextbox.Clear();
         AltTextbox.Clear();
         PictureTextbox.Clear();
     }
     else
     {
         LoadPartDetails();
     }
 }
 //Clears inputable item in details
 private void ClearItem()
 {
     AutoPartTextbox.Clear();
     QtyTextbox.Text         = "0";
     QtyLimit                = 0;
     UnitPriceTextbox.Text   = "0.00";
     TotalAmountTextbox.Text = "0.00";
 }