Example #1
0
 private void bttnModify_Click(object sender, EventArgs e)
 {
     if (clsFunctions.recordExist("SELECT tblusers.usercode, tblusers.usertype FROM tblusers WHERE (tblusers.usertype=1 && tblusers.usercode='" + clsVariables.sUsercode + "') ORDER BY tblusers.autoid ASC", "tblusers") == true)
     {
         if (lvSupplier.Items.Count > 0)
         {
             try
             {
                 FormSupplier_Modify.ADD_STATE     = false;
                 FormSupplier_Modify.sSupplierKode = lvSupplier.Items[lvSupplier.FocusedItem.Index].SubItems[0].Text;
                 FormSupplier_Modify sForm = new FormSupplier_Modify();
                 sForm.ShowDialog();
             }
             catch (ArgumentOutOfRangeException aooreE) { MessageBox.Show("" + aooreE.Message); }
             catch (NullReferenceException nreE) { }
         }
         else
         {
             MessageBox.Show("No record to edit.", clsVariables.sMSGBOX, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
     }
     else
     {
         MessageBox.Show("Anda perlu hak akses administrator untuk menggunakan fitur ini!", clsVariables.sMSGBOX, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #2
0
 private void bttnAddNew_Click(object sender, EventArgs e)
 {
     if (clsFunctions.recordExist("SELECT tblusers.usercode, tblusers.usertype FROM tblusers WHERE (tblusers.usertype=1 && tblusers.usercode='" + clsVariables.sUsercode + "') ORDER BY tblusers.autoid ASC", "tblusers") == true)
     {
         FormSupplier_Modify.ADD_STATE = true;
         FormSupplier_Modify sForm = new FormSupplier_Modify();
         sForm.ShowDialog();
     }
     else
     {
         MessageBox.Show("Anda perlu hak akses administrator untuk menggunakan fitur ini!", clsVariables.sMSGBOX, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }