public static SurveillanceTask_Cascade[] CreateInstanceFromDataAngineDataSet(DataSet ds) { if (0 == ds.Tables.Count) { return(null); } DataTable dt = ds.Tables[0]; int StCount = dt.Rows.Count; SurveillanceTask_Cascade[] sts = new SurveillanceTask_Cascade[StCount]; for (int i = 0; i < StCount; ++i) { SurveillanceTask_Cascade st = new SurveillanceTask_Cascade(); st.ID = Convert.ToInt32(dt.Rows[i]["id"]); st.Name = dt.Rows[i]["name"].ToString(); st.DatasetID = Convert.ToInt32(dt.Rows[i]["person_dataset_id"]); st.DatasetName = dt.Rows[i]["person_dataset_name"].ToString(); st.DeviceID = Convert.ToInt32(dt.Rows[i]["device_id"]); st.DeviceName = dt.Rows[i]["device_name"].ToString(); st.Type = dt.Rows[i]["type"].ToString(); st.Type_Name = dt.Rows[i]["type_name"].ToString(); st.Remark = dt.Rows[i]["remark"].ToString(); st.StartTime = dt.Rows[i]["start_time"].ToString(); st.EndTime = dt.Rows[i]["end_time"].ToString(); sts[i] = st; } return(sts); }
public static SurveillanceTask_Cascade CreateInstanceFromDataAngineModel(DataSet ds) { if (1 != ds.Tables.Count) { return(null); } DataTable dt = ds.Tables[0]; SurveillanceTask_Cascade st = new SurveillanceTask_Cascade(); st.ID = Convert.ToInt32(dt.Rows[0]["id"]); st.Name = dt.Rows[0]["name"].ToString(); st.DatasetID = Convert.ToInt32(dt.Rows[0]["person_dataset_id"]); st.DatasetName = dt.Rows[0]["person_dataset_name"].ToString(); st.DeviceID = Convert.ToInt32(dt.Rows[0]["device_id"]); st.DeviceName = dt.Rows[0]["device_name"].ToString(); st.Type = dt.Rows[0]["type"].ToString(); st.Type_Name = dt.Rows[0]["type_name"].ToString(); st.Remark = dt.Rows[0]["remark"].ToString(); st.StartTime = dt.Rows[0]["start_time"].ToString(); st.EndTime = dt.Rows[0]["end_time"].ToString(); return(st); }