void VerRegistro(int n_IdRegistro) { lstCargCab.Clear(); lstCargDet.Clear(); objRegistros.mysConec = mysConec; objRegistros.TraerRegistro(n_IdRegistro); BE_Registro = objRegistros.entCargos; lstCargCab = objRegistros.lstCargosCab; lstCargDet = objRegistros.lstCargosDet; TxtAnoTra.Text = BE_Registro.n_anotra.ToString(); TxtFchEmi.Text = BE_Registro.d_fchemi.ToString("dd/MM/yyyy"); CboTipDoc.SelectedValue = BE_Registro.n_idtipdoc; //TxtNumSer.Text = BE_Registro.; //TxtNumDoc.Text = ""; CboMesTra.SelectedValue = BE_Registro.n_mestra; //TxtGlosa.Text = BE_Registro.; TxtNumSoc.Text = BE_Registro.n_numsoc.ToString("0.00"); TxtImpBru.Text = BE_Registro.n_impbru.ToString("0.00"); TxtImpIgv.Text = BE_Registro.n_impigv.ToString("0.00"); TxtImpTot.Text = BE_Registro.n_imptot.ToString("0.00"); MostrarDatos(); }
public bool Actualizar(BE_COO_CARGOS entCargos, List <BE_COO_CARGOSCAB> LstCargosCab, List <BE_COO_CARGOSDET> LstCargosDet) { bool b_result = false; CD_coo_cargos miFun = new CD_coo_cargos(); miFun.mysConec = mysConec; b_result = miFun.Actualizar(entCargos, LstCargosCab, LstCargosDet); if (b_result == false) { booOcurrioError = miFun.booOcurrioError; StrErrorMensaje = miFun.StrErrorMensaje; IntErrorNumber = miFun.IntErrorNumber; } return(b_result); }
public bool Insertar(BE_COO_CARGOS entCargos, List <BE_COO_CARGOSCAB> LstCargosCab, List <BE_COO_CARGOSDET> LstCargosDet) { bool booOk = false; int n_row = 0; DatosMySql xMiFuncion = new DatosMySql(); if (xMiFuncion.StoreEjecutar("coo_cargos_insertar", entCargos, mysConec, 1) == true) { entCargos.n_id = Convert.ToInt32(xMiFuncion.intIdGenerado); for (n_row = 0; n_row <= LstCargosCab.Count - 1; n_row++) { BE_COO_CARGOSCAB entCargosCab = new BE_COO_CARGOSCAB(); entCargosCab = LstCargosCab[n_row]; entCargosCab.n_idcar = entCargos.n_id; if (xMiFuncion.StoreEjecutar("coo_cargoscab_insertar", entCargosCab, mysConec, null) == false) { booOcurrioError = xMiFuncion.booOcurrioError; StrErrorMensaje = xMiFuncion.StrErrorMensaje; IntErrorNumber = xMiFuncion.IntErrorNumber; return(booOk); } } for (n_row = 0; n_row <= LstCargosDet.Count - 1; n_row++) { BE_COO_CARGOSDET entCargosDet = new BE_COO_CARGOSDET(); entCargosDet = LstCargosDet[n_row]; entCargosDet.n_idcar = entCargos.n_id; if (xMiFuncion.StoreEjecutar("coo_cargosdet_insertar", entCargosDet, mysConec, null) == false) { booOcurrioError = xMiFuncion.booOcurrioError; StrErrorMensaje = xMiFuncion.StrErrorMensaje; IntErrorNumber = xMiFuncion.IntErrorNumber; return(booOk); } } booOk = true; } else { booOcurrioError = xMiFuncion.booOcurrioError; StrErrorMensaje = xMiFuncion.StrErrorMensaje; IntErrorNumber = xMiFuncion.IntErrorNumber; } return(booOk); }
public bool Actualizar(BE_COO_CARGOS entCargos, List <BE_COO_CARGOSCAB> LstCargosCab, List <BE_COO_CARGOSDET> LstCargosDet) { bool booOk = false; int n_row = 0; DatosMySql xMiFuncion = new DatosMySql(); string[,] arrParametros = new string[1, 3] { { "n_idcar", "System.INT16", entCargos.n_id.ToString() } }; booOk = xMiFuncion.StoreEjecutar("coo_cargosdet_delete", arrParametros, mysConec); if (booOk == true) { booOk = xMiFuncion.StoreEjecutar("coo_cargoscab_delete", arrParametros, mysConec); if (booOk == false) { booOcurrioError = xMiFuncion.booOcurrioError; StrErrorMensaje = xMiFuncion.StrErrorMensaje; IntErrorNumber = xMiFuncion.IntErrorNumber; } } else { booOcurrioError = xMiFuncion.booOcurrioError; StrErrorMensaje = xMiFuncion.StrErrorMensaje; IntErrorNumber = xMiFuncion.IntErrorNumber; } if (xMiFuncion.StoreEjecutar("coo_cargos_actualizar", entCargos, mysConec, null) == true) { for (n_row = 0; n_row <= LstCargosCab.Count; n_row++) { BE_COO_CARGOSCAB entCargosCab = new BE_COO_CARGOSCAB(); entCargosCab = LstCargosCab[n_row]; if (xMiFuncion.StoreEjecutar("coo_cargoscab_insertar", entCargosCab, mysConec, 1) == false) { booOcurrioError = xMiFuncion.booOcurrioError; StrErrorMensaje = xMiFuncion.StrErrorMensaje; IntErrorNumber = xMiFuncion.IntErrorNumber; return(booOk); } } for (n_row = 0; n_row <= LstCargosDet.Count; n_row++) { BE_COO_CARGOSDET entCargosDet = new BE_COO_CARGOSDET(); entCargosDet = LstCargosDet[n_row]; if (xMiFuncion.StoreEjecutar("coo_cargosdet_insertar", entCargosDet, mysConec, 1) == false) { booOcurrioError = xMiFuncion.booOcurrioError; StrErrorMensaje = xMiFuncion.StrErrorMensaje; IntErrorNumber = xMiFuncion.IntErrorNumber; return(booOk); } } booOk = true; } else { booOcurrioError = xMiFuncion.booOcurrioError; StrErrorMensaje = xMiFuncion.StrErrorMensaje; IntErrorNumber = xMiFuncion.IntErrorNumber; } return(booOk); }