Example #1
0
 private void buttonWarrentyPriceCheck_Click(object sender, EventArgs e)
 {
     this.IsBusy = true;
     if (this.textBoxItemSearch.Text.Trim().Length >= 13)
     {
         if (this.buttonWarrentyPriceCheck.Enabled)
         {
             RecieptItem RecieptItem = LSExtendedWarrenty.AppBase.DataHelper.DataProvider.GetItem(this.textBoxItemSearch.Text);
             if (RecieptItem == null)
             {
                 MessageBox.Show(this, "Item not found.", "Not Found");
             }
             else
             {
                 WarrentyItemSelction WarrentyItemSelction = new WarrentyItemSelction();
                 WarrentyItemSelction.Item = RecieptItem;
                 var result =
                     WarrentyItemSelction.ShowDialog(this);
             }
         }
     }
     else
     {
         MessageBox.Show("Please enter an Item Code or Barcode.", "Not Found");
     }
     this.IsBusy = false;
 }
Example #2
0
 private void addWarrentyButton1_Click(object sender, EventArgs e)
 {
     try
     {
         WarrentyItemSelction WarrentyItemSelction = new WarrentyItemSelction();
         WarrentyItemSelction.Item = addWarrentyButton1.Item;
         var result =
             WarrentyItemSelction.ShowDialog(this);
         if (result == System.Windows.Forms.DialogResult.OK)
         {
             if (Warranties == null)
             {
                 Warranties = new Warranty();
             }
             try
             {
                 Warranties.AddWarrenty(WarrentyItemSelction.WarrentyItem);
             }
             catch (Exception ex)
             {
                 MessageBox.Show(this, "Error Occurred While Adding Warranty. "
                                 + Environment.NewLine
                                 + "Please Check the Error Message." + Environment.NewLine
                                 + "Please take a screen shot and send to System Administrator" + Environment.NewLine + Environment.NewLine
                                 + ex.Message, "Error Occurred");
             }
         }
     }
     catch (LSExtendedWarrenty.AppBase.DataHelper.NoWarrentySettingFoundException ex)
     {
         MessageBox.Show(ex.InnerException.Message, ex.Message);
     }
 }
Example #3
0
 private void textBoxItemSearch_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == Convert.ToChar(Keys.Enter))
     {
         this.IsBusy = true;
         if (this.buttonWarrentyPriceCheck.Enabled)
         {
             RecieptItem RecieptItem = LSExtendedWarrenty.AppBase.DataHelper.DataProvider.GetItem(this.textBoxItemSearch.Text);
             if (RecieptItem == null)
             {
                 MessageBox.Show(this, "Item not found.", "Not Found");
             }
             else
             {
                 WarrentyItemSelction WarrentyItemSelction = new WarrentyItemSelction();
                 WarrentyItemSelction.Item = RecieptItem;
                 var result =
                     WarrentyItemSelction.ShowDialog(this);
             }
         }
         this.IsBusy = false;
     }
 }
Example #4
0
        private void buttonAddSerial_Click(object sender, EventArgs e)
        {
            WarrentyItem Slip = null;

            foreach (var warranty in Warranties)
            {
                if (warranty.ItemId == this.comboBoxWarrenties.Text)
                {
                    Slip = warranty;
                }
            }
            if (Slip != null)
            {
                WarrentyItemSelction WarrentyItemSelction = new WarrentyItemSelction();
                WarrentyItemSelction.Item = Slip;
                var result =
                    WarrentyItemSelction.ShowDialog(this);

                /*
                 * if (result == System.Windows.Forms.DialogResult.Cancel)
                 * {
                 *  MessageBox.Show("Canceled");
                 * }*/
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    try
                    {
                        Slip.SerialNumber = Slip.SerialNumber + ";" + WarrentyItemSelction.WarrentyItem.SerialNumber;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
            comboBoxWarrenties_SelectedIndexChanged(this.comboBoxWarrenties.SelectedIndex, new EventArgs());
        }