Esempio n. 1
0
 private void vs_DoubleClick(object sender, EventArgs e)
 {
     if (vs.Row <= 0)
     {
         return;
     }
     if (MessageBox.Show(this, PublicFunction.L_Get_Msg("msg", 15), this.Text, MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         SqlConnection con = new SqlConnection(PublicFunction.C_con.ConnectionString);
         con.Open();
         SqlTransaction tran = con.BeginTransaction();
         try
         {
             string sql = "";
             sql = "Update FILB01A set DEL_BT=0 where EMP_ID=N'" + vs.Rows[vs.Row]["EMP_ID"] + "'";
             SqlCommand cmd = new SqlCommand(sql, con, tran);
             cmd.ExecuteNonQuery();
             sql = "delete from FILB01AD where EMP_ID=N'" + vs.Rows[vs.Row]["EMP_ID"] + "'";
             cmd = new SqlCommand(sql, con, tran);
             cmd.ExecuteNonQuery();
             vs.RemoveItem(vs.Row);
             tran.Commit();
         }
         catch (Exception ex)
         {
             tran.Rollback();
             MessageBox.Show(ex.Message);
             con.Close();
             return;
         }
         MessageBox.Show(PublicFunction.L_Get_Msg("Staff", 1));
         con.Close();
     }
 }