/// <summary> /// 增加一条数据 /// </summary> public int Add(Dianda.Model.Cash_Cards model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Dianda.Model.Cash_Cards model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <Dianda.Model.Cash_Cards> DataTableToList(DataTable dt) { List <Dianda.Model.Cash_Cards> modelList = new List <Dianda.Model.Cash_Cards>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Dianda.Model.Cash_Cards model; for (int n = 0; n < rowsCount; n++) { model = new Dianda.Model.Cash_Cards(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } model.CardNum = dt.Rows[n]["CardNum"].ToString(); model.CardName = dt.Rows[n]["CardName"].ToString(); model.CardholderID = dt.Rows[n]["CardholderID"].ToString(); model.DepartmentID = dt.Rows[n]["DepartmentID"].ToString(); if (dt.Rows[n]["ProjectID"].ToString() != "") { model.ProjectID = int.Parse(dt.Rows[n]["ProjectID"].ToString()); } if (dt.Rows[n]["Balance"].ToString() != "") { model.Balance = decimal.Parse(dt.Rows[n]["Balance"].ToString()); } if (dt.Rows[n]["LimitNums"].ToString() != "") { model.LimitNums = decimal.Parse(dt.Rows[n]["LimitNums"].ToString()); } model.ApproverIDs = dt.Rows[n]["ApproverIDs"].ToString(); if (dt.Rows[n]["DATETIME"].ToString() != "") { model.DATETIME = DateTime.Parse(dt.Rows[n]["DATETIME"].ToString()); } if (dt.Rows[n]["Statas"].ToString() != "") { model.Statas = int.Parse(dt.Rows[n]["Statas"].ToString()); } model.DoUserID = dt.Rows[n]["DoUserID"].ToString(); if (dt.Rows[n]["EndTime"].ToString() != "") { model.EndTime = DateTime.Parse(dt.Rows[n]["EndTime"].ToString()); } model.TEMP0 = dt.Rows[n]["TEMP0"].ToString(); model.TEMP1 = dt.Rows[n]["TEMP1"].ToString(); model.TEMP2 = dt.Rows[n]["TEMP2"].ToString(); model.TEMP3 = dt.Rows[n]["TEMP3"].ToString(); if (dt.Rows[n]["SpecialFundsID"].ToString() != "") { model.SpecialFundsID = int.Parse(dt.Rows[n]["SpecialFundsID"].ToString()); } if (dt.Rows[n]["SFOrderID"].ToString() != "") { model.SFOrderID = int.Parse(dt.Rows[n]["SFOrderID"].ToString()); } if (dt.Rows[n]["YEBalance"].ToString() != "") { model.YEBalance = decimal.Parse(dt.Rows[n]["YEBalance"].ToString()); } modelList.Add(model); } } return(modelList); }