public taskCompositeType GetTaskById(int iIdTask) { taskCompositeType et = new taskCompositeType(); param = new SqlParameter[1]; param[0] = new SqlParameter("@fiid_task", SqlDbType.Int) { Value = iIdTask }; DataTable dt = objDB.ExecStore("sp_getTaskById", param); et.iIdTask = 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()); et.iIdArea = int.Parse(dt.Rows[0].ItemArray[3].ToString()); et.sDescriptionArea = dt.Rows[0].ItemArray[4].ToString(); return(et); }
/// <summary> /// Obtiene todos los Tipos de Cambio /// </summary> /// <returns></returns> public List <taskCompositeType> getAll() { List <taskCompositeType> lst = new List <taskCompositeType>(); DataTable dt = objDB.Consult("sp_selectTask"); foreach (DataRow dr in dt.Rows) { var et = new taskCompositeType { iIdTask = int.Parse(dr.ItemArray[0].ToString()), sDescription = dr.ItemArray[1].ToString(), bStatus = bool.Parse(dr.ItemArray[2].ToString()), iIdArea = int.Parse(dr.ItemArray[3].ToString()), sDescriptionArea = dr.ItemArray[4].ToString() }; lst.Add(et); } return(lst); }