Beispiel #1
0
 private void addToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     using (CustomerDemo form = new CustomerDemo(null, "Patient"))
     {
         DialogResult dr = form.ShowDialog();
         if (dr == DialogResult.OK)
         {
             viewToolStripMenuItem_Click_1(null, null);
         }
     }
 }
Beispiel #2
0
 private void button5_Click(object sender, EventArgs e)
 {
     using (CustomerDemo form = new CustomerDemo(null, "Patient"))
     {
         DialogResult dr = form.ShowDialog();
         if (dr == DialogResult.OK)
         {
             AutoCompleteCustomer();
         }
     }
 }
Beispiel #3
0
 private void button5_Click(object sender, EventArgs e)
 {
     using (CustomerDemo form = new CustomerDemo(null, "Patient"))
     {
         DialogResult dr = form.ShowDialog();
         if (dr == DialogResult.OK)
         {
             // LoadingCalendarLite();
         }
     }
 }
Beispiel #4
0
 private void dtGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 1)
     {
         using (CustomerDemo form = new CustomerDemo(dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["category"].Value.ToString()))
         {
             DialogResult dr = form.ShowDialog();
             if (dr == DialogResult.OK)
             {
             }
         }
     }
 }
Beispiel #5
0
 private void button3_Click_1(object sender, EventArgs e)
 {
     using (CustomerDemo form = new CustomerDemo(null, "Patient"))
     {
         DialogResult dr = form.ShowDialog();
         if (dr == DialogResult.OK)
         {
             AutoCompleteCustomer();
             customerCbx.Text = Helper.CurrentCustomer;
             customerCbx_SelectedIndexChanged(null, null);
         }
     }
 }
Beispiel #6
0
        private void dtGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (e.ColumnIndex == dtGrid.Columns["Select"].Index && e.RowIndex >= 0)
            {
                dtGrid.CurrentCell.Value = dtGrid.CurrentCell.FormattedValue.ToString() == "True" ? false : true;
                dtGrid.RefreshEdit();
                if (selectedIDs.Contains(dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString()))
                {
                    selectedIDs.Remove(dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString());
                }
                else
                {
                    selectedIDs.Add(dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString());
                }
            }
            if (e.ColumnIndex == dtGrid.Columns["View"].Index && e.RowIndex >= 0)
            {
                using (CustomerDemo form = new CustomerDemo(dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString(), dtGrid.Rows[e.RowIndex].Cells["category"].Value.ToString()))
                {
                    DialogResult dr = form.ShowDialog();
                    if (dr == DialogResult.OK)
                    {
                        LoadData();
                    }
                }
            }
            try
            {
                if (e.ColumnIndex == dtGrid.Columns["Delete"].Index && e.RowIndex >= 0)
                {
                    if (MessageBox.Show("YES or No?", "Are you sure you want to delete this Customer? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                    {
                        string Query = "DELETE from customer WHERE id ='" + dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString() + "'";
                        MySQL.Query(Query);
                        //Queries q = new Queries(Guid.NewGuid().ToString(), Helper.UserName, Helper.CleanString(Query), "false", DateTime.Now.ToString("dd-MM-yyyy H:m:s"), Helper.CompanyID);
                        // MySQL.Insert(q);
                        MessageBox.Show("Information deleted");
                        LoadData();
                        Helper.Log(Helper.UserName, "Deleted patient information " + dtGrid.Rows[e.RowIndex].Cells["name"].Value.ToString() + "  " + DateTime.Now);
                    }
                }
            }
            catch { }
        }