public DataTypeCompositeType GetDataTypeById(int iIdDataType) { var et = new DataTypeCompositeType(); try { var param = new SqlParameter[1]; param[0] = new SqlParameter("@fiid_data_type", SqlDbType.Int) { Value = iIdDataType }; DataTable dt = objDB.ExecStore("sp_getDataTypeById", param); et.iIdDataType = int.Parse(dt.Rows[0].ItemArray[0].ToString()); et.sDescription = dt.Rows[0].ItemArray[1].ToString(); et.bStatus = bool.Parse(dt.Rows[0].ItemArray[2].ToString()); return(et); } catch (Exception ex) { throw new Exception(); } }
/// <summary> /// Obtiene todos los Tipos de Cambio /// </summary> /// <returns></returns> public List <DataTypeCompositeType> getAll() { var lst = new List <DataTypeCompositeType>(); try { DataTable dt = objDB.Consult("sp_selectDataType"); foreach (DataRow dr in dt.Rows) { var swap = new DataTypeCompositeType { iIdDataType = int.Parse(dr.ItemArray[0].ToString()), sDescription = dr.ItemArray[1].ToString(), bStatus = bool.Parse(dr.ItemArray[2].ToString()) }; lst.Add(swap); } return(lst); } catch (Exception ex) { throw new Exception(); } }