public static bool DeleteData(Grupo_TiposRecord pComp, ref string sMensaje) { bool bRetorno = true; try { GRUPO_TIPOS oCom = new GRUPO_TIPOS(); oCom.ConnectionString = Parametros.CadenaConexion; oCom.LoadByPrimaryKey(pComp.GRUPO_TIPO_ID); oCom.MarkAsDeleted(); oCom.Save(); } catch (Exception ex) { sMensaje = ex.Message.ToString(); bRetorno = false; } return(bRetorno); }
public static bool SaveData(Grupo_TiposRecord pComp, ref string sMensaje, bool bAdiciona) { bool bRetorno = true; try { GRUPO_TIPOS oCom = new GRUPO_TIPOS(); oCom.ConnectionString = Parametros.CadenaConexion; if (!bAdiciona) { oCom.LoadByPrimaryKey(pComp.GRUPO_TIPO_ID); } else { oCom.AddNew(); } oCom.CODIGO = pComp.CODIGO; oCom.NOMBRE = pComp.NOMBRE; oCom.DESCR = pComp.DESCR; oCom.Save(); } catch (Exception ex) { sMensaje = ex.Message.ToString(); bRetorno = false; } return(bRetorno); }