/// <summary> /// 获得数据列表 /// </summary> public List <Daiv_OA.Entity.PlanEntity> DataTableToList(DataTable dt) { List <Daiv_OA.Entity.PlanEntity> modelList = new List <Daiv_OA.Entity.PlanEntity>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Daiv_OA.Entity.PlanEntity model; for (int n = 0; n < rowsCount; n++) { model = new Daiv_OA.Entity.PlanEntity(); if (dt.Rows[n]["Pwid"].ToString() != "") { model.Pwid = int.Parse(dt.Rows[n]["Pwid"].ToString()); } if (dt.Rows[n]["Uid"].ToString() != "") { model.Uid = int.Parse(dt.Rows[n]["Uid"].ToString()); } if (dt.Rows[n]["Pwdate"].ToString() != "") { model.Pwdate = DateTime.Parse(dt.Rows[n]["Pwdate"].ToString()); } model.Pwpath = dt.Rows[n]["Pwpath"].ToString(); model.Locked = dt.Rows[n]["Locked"].ToString(); model.Manager = dt.Rows[n]["Manager"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Daiv_OA.Entity.PlanEntity model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Daiv_OA.Entity.PlanEntity model) { return(dal.Add(model)); }