void VerRegistro(int n_IdRegistro) { DataTable dtResult = new DataTable(); DataTable dtPago = new DataTable(); DataTable dtHora = new DataTable(); objRegistro.TraerRegistro(n_IdRegistro); if (objRegistro.b_OcurrioError == true) { MessageBox.Show("¡ No se puede mostrar el registro por el siguiente motivo ! " + objRegistro.c_ErrorMensaje, "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); return; } entCargos = objRegistro.e_Cargos; dtPago = objRegistro.dtPago; dtHora = objRegistro.dtHora; FgLisPer.Rows.Count = 2; TxtNumSer.Text = entCargos.c_numser; TxtNumDoc.Text = entCargos.c_numdoc; TxtFchReg.Text = entCargos.d_fchreg.ToString(); TxtFchIni.Text = entCargos.d_fchini.ToString(); TxtFchFin.Text = entCargos.d_fchfin.ToString(); CboRes.SelectedValue = entCargos.n_idres; TxtObs.Text = entCargos.c_glo.ToString(); CboLocal.SelectedValue = entCargos.n_idlocal; MostrarPago(dtPago); MostrarHora(dtHora); TabDetalle.SelectedIndex = 0; }
public bool Insertar(BE_PLA_DESTAJO e_Cargos) { bool booOk = false; DatosMySql xMiFuncion = new DatosMySql(); int n_row = 0; double n_idgen = 0; MySqlTransaction trans; mysConec = xMiFuncion.ReAbrirConeccion(mysConec); trans = mysConec.BeginTransaction(); try { if (xMiFuncion.StoreEjecutar("pla_destajo_insertar", e_Cargos, mysConec, 1) == true) { n_idgen = xMiFuncion.intIdGenerado; string[,] arrParametros = new string[5, 3] { { "n_idpla", "System.INT32", Convert.ToInt32(n_idgen).ToString() }, { "n_idemp", "System.INT32", e_Cargos.n_idemp.ToString() }, { "c_fchini", "System.STRING", e_Cargos.d_fchini.ToString("dd/MM/yyyy") }, { "c_fchfin", "System.STRING", e_Cargos.d_fchfin.ToString("dd/MM/yyyy") }, { "n_idlocal", "System.STRING", e_Cargos.n_idlocal.ToString() }, }; if (xMiFuncion.StoreEjecutar("pla_destajodet_insertar", arrParametros, mysConec) == false) { b_OcurrioError = xMiFuncion.booOcurrioError; c_ErrorMensaje = xMiFuncion.StrErrorMensaje; n_ErrorNumber = xMiFuncion.IntErrorNumber; trans.Rollback(); return(booOk); } booOk = true; } else { b_OcurrioError = xMiFuncion.booOcurrioError; c_ErrorMensaje = xMiFuncion.StrErrorMensaje; n_ErrorNumber = xMiFuncion.IntErrorNumber; trans.Rollback(); return(booOk); } trans.Commit(); return(booOk); } catch (Exception exc) { // SI SUCEDE UN ERROR DEVOLVEMOS FALSO b_OcurrioError = xMiFuncion.booOcurrioError; c_ErrorMensaje = xMiFuncion.StrErrorMensaje; n_ErrorNumber = xMiFuncion.IntErrorNumber; trans.Rollback(); return(booOk); } }
public bool Actualizar(BE_PLA_DESTAJO e_Cargos) { CD_pla_destajo miFun = new CD_pla_destajo(); bool booOk = false; miFun.mysConec = mysConec; booOk = miFun.Actualizar(e_Cargos); if (booOk == false) { b_OcurrioError = miFun.b_OcurrioError; c_ErrorMensaje = miFun.c_ErrorMensaje; n_ErrorNumber = miFun.n_ErrorNumber; } return(booOk); }