public override HYLAN_TASKDC LoadByPrimaryKey(DBConnection Connection, int TASK_TITLE_ID, int JOB_ID) { TASK_FIBER_POWER_DIGDC objTASK_FIBER_POWER_DIG = new TASK_FIBER_POWER_DIGDC(); StringBuilder sql = new StringBuilder(); sql.Append("proc_TASK_FIBER_POWER_DIGLoadByPrimaryKey"); DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection); dbCommandWrapper.AddInParameter("p_JOB_ID", DbType.Int32, JOB_ID); dbCommandWrapper.AddInParameter("p_TASK_TITLE_ID", DbType.Int32, TASK_TITLE_ID); DataSet ds = new DataSet(); if (Connection.Transaction != null) { ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand, Connection.Transaction); } else { ds = Connection.dataBase.ExecuteDataSet(dbCommandWrapper.DBCommand); } objTASK_FIBER_POWER_DIG = (Utility.ConvertToObject <TASK_FIBER_POWER_DIGDC>(ds.Tables[0])); if (ds.Tables.Count > 1) { HYLAN_TASKDC hylanTaskDC = (Utility.ConvertToObject <HYLAN_TASKDC>(ds.Tables[1])); objTASK_FIBER_POWER_DIG.TASK_TITLE_ID = hylanTaskDC.TASK_TITLE_ID; objTASK_FIBER_POWER_DIG.TASK_NAME = hylanTaskDC.TASK_NAME; } return(objTASK_FIBER_POWER_DIG); }
public IHttpActionResult Get(int TASK_TITLE_ID, int JOB_ID) { HYLAN_TASKBL HYLAN_TASKBL = new HYLAN_TASKBL(); HYLAN_TASKDC objResult = new HYLAN_TASKDC(); objResult = HYLAN_TASKBL.LoadByPrimaryKey(TASK_TITLE_ID, JOB_ID); return(Ok(new { objResult })); }
public HYLAN_TASKDC LoadByPrimaryKey(int TASK_TITLE_ID, int JOB_ID) { DBConnection objConnection = new DBConnection(); HYLAN_TASKDA HYLAN_TASKDA = HylanTaskDAFactory.Create(TASK_TITLE_ID); HYLAN_TASKDC HYLAN_TASKDC = null; try { objConnection.Open(false); HYLAN_TASKDC = HYLAN_TASKDA.LoadByPrimaryKey(objConnection, TASK_TITLE_ID, JOB_ID); } catch (Exception ex) { throw ex; } finally { objConnection.Close(); } return(HYLAN_TASKDC); }