/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_SendCar> DataTableToList(DataTable dt) { List <MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_SendCar> modelList = new List <MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_SendCar>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_SendCar model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_SendCar(); if (dt.Rows[n]["InfoId"].ToString() != "") { model.InfoId = int.Parse(dt.Rows[n]["InfoId"].ToString()); } if (dt.Rows[n]["Tb_WorkFlow_FlowSort_InfoId"].ToString() != "") { model.Tb_WorkFlow_FlowSort_InfoId = int.Parse(dt.Rows[n]["Tb_WorkFlow_FlowSort_InfoId"].ToString()); } model.UserCode = dt.Rows[n]["UserCode"].ToString(); model.UseCarMan = dt.Rows[n]["UseCarMan"].ToString(); model.UseMark = dt.Rows[n]["UseMark"].ToString(); if (dt.Rows[n]["StartDate"].ToString() != "") { model.StartDate = DateTime.Parse(dt.Rows[n]["StartDate"].ToString()); } if (dt.Rows[n]["EndDate"].ToString() != "") { model.EndDate = DateTime.Parse(dt.Rows[n]["EndDate"].ToString()); } model.OprUser = dt.Rows[n]["OprUser"].ToString(); model.Place = dt.Rows[n]["Place"].ToString(); model.CarNum = dt.Rows[n]["CarNum"].ToString(); model.InfoContent = dt.Rows[n]["InfoContent"].ToString(); model.DocumentUrl = dt.Rows[n]["DocumentUrl"].ToString(); if (dt.Rows[n]["WorkStartDate"].ToString() != "") { model.WorkStartDate = DateTime.Parse(dt.Rows[n]["WorkStartDate"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_SendCar model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_SendCar model) { return(dal.Add(model)); }