Exemplo n.º 1
0
 private void txtItemSearch_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtItemSearch.Text))
         {
             ItemSales.AllSales(dataGridSalesRecord, txtItemSearch.Text);
             lblTotal.Text = string.Format("{0:00.#0}", ItemSales.TodayTotal);
         }
         else
         {
             ItemSales.AllSales(dataGridSalesRecord, "");
             lblTotal.Text = string.Format("{0:00.#0}", ItemSales.TodayTotal);
         }
     }catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Search Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 2
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try{
         if (dateSelect == true)
         {
             if (MessageBox.Show("All records will be Deleted for Selected Date\nContinue ?", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
             {
                 ItemSales.DeleteSale(dateTimeFrom);
                 dataAccess.Description = "Deleted all Sales record for " + dateTimeFrom.Value.ToString("MM/dd/yyyy");
                 dataAccess.Activities();
                 ItemSales.AllSales(dataGridSalesRecord, "");
                 dateSelect = false;
             }
         }
         else
         {
             if (MessageBox.Show("Confirm Delete of Selected Record", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
             {
                 if (SalesID <= 0)
                 {
                     throw new Exception("Select a record to Delete");
                 }
                 else
                 {
                     ItemSales.DeleteSale(SalesID);
                     dataAccess.Description = "Deleted an item from Sales record";
                     dataAccess.Activities();
                     ItemSales.AllSales(dataGridSalesRecord, "");
                     SalesID = 0;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 3
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (ItemSales.isSaleMade() == true)
            {
                //TODO
                ///REFRESH THE SALES RECOD
                ItemSales.AllSales(dataGridSalesRecord, "");
                timer1.Stop();
            }
            else
            {
                timer1.Stop();
            }

            if (ItemSales.isSaleDeleted() == true)
            {
                ItemSales.AllSales(dataGridSalesRecord, "");
                timer1.Stop();
            }
            else
            {
                timer1.Stop();
            }
        }
Exemplo n.º 4
0
 private void btnRefresh_Click(object sender, EventArgs e)
 {
     dateSelect = false;
     ItemSales.AllSales(dataGridSalesRecord, "");
 }
Exemplo n.º 5
0
 public Sales_Record()
 {
     InitializeComponent();
     ItemSales.AllSales(dataGridSalesRecord, txtItemSearch.Text);
     ItemSales.ItemNames(combItemName);
 }