Beispiel #1
0
 private void btnInputData_Click(object sender, EventArgs e)
 {
     if (User.statusLogin == true)
     {
         Menu           menu = new Menu();
         InputEquipment ie   = new InputEquipment();
         ie.btnSubmit.Visible = true;
         ie.btnUpdate.Visible = false;
         ie.statusAlat.Items.Remove("Rusak");
         ie.statusAlat.Items.Remove("Dibuang");
         ie.statusAlat.SelectedItem = "Cadangan";
         menu.menuClick(ie);
     }
     else
     {
         if (MessageBox.Show("Anda Harus Login Untuk Bisa Input Data\nLogin sekarang?", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
         {
             FormLogin fl = new FormLogin();
             if (fl.ShowDialog() == DialogResult.OK)
             {
                 Menu menu = new Menu();
                 menu.menuClick(new InputEquipment());
             }
         }
     }
 }
Beispiel #2
0
 private void Dgv_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == dgv.Columns["Edit/Delete"].Index)
     {
         if (e.RowIndex != -1)
         {
             Menu           menu = new Menu();
             InputEquipment ei   = new InputEquipment();
             var            kode = dgv.Rows[e.RowIndex].Cells[0].Value;
             ei.editData(kode.ToString());
             ei.btnUpdate.Visible = true;
             ei.btnSubmit.Visible = false;
             menu.menuClick(ei);
         }
     }
 }