public reasonCompositeType GetReasonById(int iIdReason) { reasonCompositeType et = new reasonCompositeType(); //try //{ param = new SqlParameter[1]; param[0] = new SqlParameter("@fiid_reason", SqlDbType.Int); param[0].Value = iIdReason; DataTable dt = objDB.ExecStore("sp_getReasonById", param); et.iIdReason = int.Parse(dt.Rows[0].ItemArray[0].ToString()); et.iNumber = int.Parse(dt.Rows[0].ItemArray[1].ToString()); et.sDescription = dt.Rows[0].ItemArray[2].ToString(); et.bStatus = bool.Parse(dt.Rows[0].ItemArray[3].ToString()); return(et); //} //catch (Exception ex) //{ // throw ex.Message(); //} }
/// <summary> /// Obtiene todos los Tipos de Cambio /// </summary> /// <returns></returns> public List <reasonCompositeType> getAll() { List <reasonCompositeType> lst = new List <reasonCompositeType>(); //try //{ DataTable dt = objDB.Consult("sp_selectReason"); foreach (DataRow dr in dt.Rows) { reasonCompositeType et = new reasonCompositeType(); et.iIdReason = int.Parse(dr.ItemArray[0].ToString()); et.iNumber = int.Parse(dr.ItemArray[1].ToString()); et.sDescription = dr.ItemArray[2].ToString(); et.bStatus = bool.Parse(dr.ItemArray[3].ToString()); lst.Add(et); } return(lst); //} //catch (Exception ex) //{ // throw ex.Message(); //} }