public DetaliiImpozitar_anual GetDetalii(int setID) { SqlParameter[] parameters = { new SqlParameter("@ImpozitarID", SqlDbType.Int, 4) }; parameters[0].Value = setID; using(DataSet detaliiDS = RunProcedure("sal_GetImpozitarAnualById", parameters, "Detalii")) { DetaliiImpozitar_anual detalii = new DetaliiImpozitar_anual(); if (detaliiDS.Tables[0].Rows.Count > 0) { DataRow rowDetalii = detaliiDS.Tables[0].Rows[0]; detalii.ID = (int)rowDetalii["ImpozitarID"]; detalii.Data = (DateTime)rowDetalii["Data"]; detalii.ValMin = (decimal)rowDetalii["ValMin"]; detalii.ValMax = (decimal)rowDetalii["ValMax"]; detalii.Suma=(decimal)rowDetalii["Suma"]; detalii.Procent=(decimal)rowDetalii["Procent"]; detalii.CategorieID=(int)rowDetalii["CategorieID"]; } else detalii.ID = -1; return detalii; } }
public DetaliiImpozitar_anual GetDetalii(DateTime data,decimal suma,int categorieId) { SqlParameter[] parameters = {new SqlParameter("@Data", SqlDbType.DateTime, 8), new SqlParameter("@Suma", SqlDbType.Money, 8), new SqlParameter("@CategorieID", SqlDbType.Int, 4)}; parameters[0].Value = data; parameters[1].Value = suma; parameters[2].Value = categorieId; using(DataSet detaliiDS = RunProcedure("sal_GetImpozitarAnual", parameters, "Impozitar")) { DetaliiImpozitar_anual detalii = new DetaliiImpozitar_anual(); if (detaliiDS.Tables[0].Rows.Count > 0) { DataRow rowDetalii = detaliiDS.Tables[0].Rows[0]; detalii.ID = (int)rowDetalii["ImpozitarID"]; detalii.Data = (DateTime)rowDetalii["Data"]; detalii.ValMin = (decimal)rowDetalii["ValMin"]; detalii.ValMax = (decimal)rowDetalii["ValMax"]; detalii.Suma=(decimal)rowDetalii["Suma"]; detalii.Procent=(decimal)rowDetalii["Procent"]; detalii.CategorieID=(int)rowDetalii["CategorieID"]; } else detalii.ID = -1; return detalii; } }