Exemplo n.º 1
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     if (dgw.Rows.Count == 0)
     {
         Interaction.MsgBox("Please select record to update", MsgBoxStyle.Exclamation, "Update");
         return;
     }
     try
     {
         if (string.IsNullOrEmpty(dgw.CurrentRow.Cells[0].Value.ToString()))
         {
         }
         else
         {
             SQLConn.adding   = false;
             SQLConn.updating = true;
             customerID       = Convert.ToInt32(dgw.CurrentRow.Cells[0].Value.ToString());
             frmAddEditCustomer aeC = new frmAddEditCustomer(customerID);
             aeC.ShowDialog();
         }
     }
     catch
     {
         Interaction.MsgBox("Please select record to update", MsgBoxStyle.Exclamation, "Update");
         return;
     }
 }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (ListView1.Items.Count == 0)
            {
                Interaction.MsgBox("Please select record to update", MsgBoxStyle.Exclamation, "Update");
                return;
            }
            try
            {
                if (string.IsNullOrEmpty(ListView1.FocusedItem.Text))
                {
                }
                else
                {
                    SQLConn.adding   = false;
                    SQLConn.updating = true;
                    customerID       = Convert.ToInt32(ListView1.FocusedItem.Text);
                    frmAddEditCustomer f2 = new frmAddEditCustomer(customerID);
                    f2.ShowDialog();

                    LoadCustomers("");
                }
            }
            catch
            {
                Interaction.MsgBox("Please select record to update", MsgBoxStyle.Exclamation, "Update");
                return;
            }
        }
Exemplo n.º 3
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            SQLConn.adding   = true;
            SQLConn.updating = false;
            int init = 0;
            frmAddEditCustomer aeC = new frmAddEditCustomer(init);

            aeC.ShowDialog();
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            SQLConn.adding   = true;
            SQLConn.updating = false;
            int init = 0;
            frmAddEditCustomer f2 = new frmAddEditCustomer(init);

            f2.ShowDialog();
            LoadInvoices("");
        }