Ejemplo n.º 1
0
 private void button6_Click(object sender, EventArgs e)
 {
     using (AddItem form = new AddItem(null))
     {
         DialogResult dr = form.ShowDialog();
         if (dr == DialogResult.OK)
         {
         }
     }
 }
Ejemplo n.º 2
0
 private void toolStripMenuItem5_Click_1(object sender, EventArgs e)
 {
     using (AddItem form = new AddItem(null))
     {
         DialogResult dr = form.ShowDialog();
         if (dr == DialogResult.OK)
         {
             toolStripMenuItem6_Click_1(null, null);
         }
     }
 }
Ejemplo n.º 3
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     using (AddItem form = new AddItem(null))
     {
         DialogResult dr = form.ShowDialog();
         if (dr == DialogResult.OK)
         {
             // LoadingCalendarLite();
         }
     }
 }
Ejemplo n.º 4
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 (AddItem form = new AddItem(dtGrid.Rows[e.RowIndex].Cells["id"].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 Product? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                    {
                        string Query = "DELETE from product 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();
                    }
                }
            }
            catch { }
        }