public string Deleta(TRegistro_CadSafra vRegistro) { Hashtable hs = new Hashtable(1); hs.Add("@P_ANOSAFRA", vRegistro.AnoSafra); return(executarProc("EXCLUI_GRO_SAFRA", hs)); }
public string Grava(TRegistro_CadSafra vRegistro) { Hashtable hs = new Hashtable(4); hs.Add("@P_ANOSAFRA", vRegistro.AnoSafra); hs.Add("@P_DS_SAFRA", vRegistro.DS_Safra); hs.Add("@P_DT_INISAFRA", vRegistro.Dt_inisafra); hs.Add("@P_DT_FINSAFRA", vRegistro.Dt_finsafra); return(executarProc("IA_GRO_SAFRA", hs)); }
public TList_CadSafra Select(TpBusca[] vBusca, int vTop, string vNM_Campo) { TList_CadSafra lista = new TList_CadSafra(); bool podeFecharBco = false; if (Banco_Dados == null) { podeFecharBco = CriarBanco_Dados(false); } SqlDataReader reader = ExecutarBusca(SqlCodeBusca(vBusca, Convert.ToInt16(vTop), vNM_Campo)); try { while (reader.Read()) { TRegistro_CadSafra reg = new TRegistro_CadSafra(); if (!reader.IsDBNull(reader.GetOrdinal("anosafra"))) { reg.AnoSafra = reader.GetString(reader.GetOrdinal("anosafra")); } if (!reader.IsDBNull(reader.GetOrdinal("ds_safra"))) { reg.DS_Safra = reader.GetString(reader.GetOrdinal("ds_safra")); } if (!reader.IsDBNull(reader.GetOrdinal("dt_inisafra"))) { reg.Dt_inisafra = reader.GetDateTime(reader.GetOrdinal("dt_inisafra")); } if (!reader.IsDBNull(reader.GetOrdinal("dt_finsafra"))) { reg.Dt_finsafra = reader.GetDateTime(reader.GetOrdinal("dt_finsafra")); } lista.Add(reg); } } finally { reader.Close(); reader.Dispose(); if (podeFecharBco) { deletarBanco_Dados(); } } return(lista); }