/// <summary> /// 获得数据列表 /// </summary> public List <Dianda.Model.Project_Apply> DataTableToList(DataTable dt) { List <Dianda.Model.Project_Apply> modelList = new List <Dianda.Model.Project_Apply>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Dianda.Model.Project_Apply model; for (int n = 0; n < rowsCount; n++) { model = new Dianda.Model.Project_Apply(); 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()); } 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()); } model.AppType = dt.Rows[n]["AppType"].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(); model.DepartmentID = dt.Rows[n]["DepartmentID"].ToString(); if (dt.Rows[n]["ReadTime"].ToString() != "") { model.ReadTime = DateTime.Parse(dt.Rows[n]["ReadTime"].ToString()); } model.DoUserID = dt.Rows[n]["DoUserID"].ToString(); model.CheckNote = dt.Rows[n]["CheckNote"].ToString(); model.TelNum = dt.Rows[n]["TelNum"].ToString(); model.DoNote = dt.Rows[n]["DoNote"].ToString(); model.Attachments = dt.Rows[n]["Attachments"].ToString(); model.ApplyUserID = dt.Rows[n]["ApplyUserID"].ToString(); model.TEMP1 = dt.Rows[n]["TEMP1"].ToString(); model.TEMP2 = dt.Rows[n]["TEMP2"].ToString(); model.TEMP3 = dt.Rows[n]["TEMP3"].ToString(); model.TEMP4 = dt.Rows[n]["TEMP4"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Dianda.Model.Project_Apply model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Dianda.Model.Project_Apply model) { return(dal.Add(model)); }