/// <summary> /// 增加一条数据 /// </summary> public int Add(Dianda.Model.Project_Task model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Dianda.Model.Project_Task model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <Dianda.Model.Project_Task> DataTableToList(DataTable dt) { List <Dianda.Model.Project_Task> modelList = new List <Dianda.Model.Project_Task>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Dianda.Model.Project_Task model; for (int n = 0; n < rowsCount; n++) { model = new Dianda.Model.Project_Task(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["ProjectID"].ToString() != "") { model.ProjectID = int.Parse(dt.Rows[n]["ProjectID"].ToString()); } model.NAMES = dt.Rows[n]["NAMES"].ToString(); if (dt.Rows[n]["DELFLAG"].ToString() != "") { model.DELFLAG = int.Parse(dt.Rows[n]["DELFLAG"].ToString()); } if (dt.Rows[n]["Status"].ToString() != "") { model.Status = int.Parse(dt.Rows[n]["Status"].ToString()); } if (dt.Rows[n]["CompleteType"].ToString() != "") { model.CompleteType = int.Parse(dt.Rows[n]["CompleteType"].ToString()); } model.UserIDs = dt.Rows[n]["UserIDs"].ToString(); model.UserInfo = dt.Rows[n]["UserInfo"].ToString(); if (dt.Rows[n]["StartTime"].ToString() != "") { model.StartTime = DateTime.Parse(dt.Rows[n]["StartTime"].ToString()); } if (dt.Rows[n]["EndTime"].ToString() != "") { model.EndTime = DateTime.Parse(dt.Rows[n]["EndTime"].ToString()); } model.Overviews = dt.Rows[n]["Overviews"].ToString(); if (dt.Rows[n]["DATETIME"].ToString() != "") { model.DATETIME = DateTime.Parse(dt.Rows[n]["DATETIME"].ToString()); } model.SendUserID = dt.Rows[n]["SendUserID"].ToString(); if (dt.Rows[n]["ReadTime"].ToString() != "") { model.ReadTime = DateTime.Parse(dt.Rows[n]["ReadTime"].ToString()); } if (dt.Rows[n]["UpID"].ToString() != "") { model.UpID = int.Parse(dt.Rows[n]["UpID"].ToString()); } if (dt.Rows[n]["IsFather"].ToString() != "") { model.IsFather = int.Parse(dt.Rows[n]["IsFather"].ToString()); } modelList.Add(model); } } return(modelList); }