/// <summary> /// 获得数据列表 /// </summary> public List <Hotel_app.Model.View_Xxfmx_lk> DataTableToList(DataTable dt) { List <Hotel_app.Model.View_Xxfmx_lk> modelList = new List <Hotel_app.Model.View_Xxfmx_lk>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hotel_app.Model.View_Xxfmx_lk model; for (int n = 0; n < rowsCount; n++) { model = new Hotel_app.Model.View_Xxfmx_lk(); if (dt.Rows[n]["lksj"] != null && dt.Rows[n]["lksj"].ToString() != "") { model.lksj = DateTime.Parse(dt.Rows[n]["lksj"].ToString()); } if (dt.Rows[n]["xfsl"] != null && dt.Rows[n]["xfsl"].ToString() != "") { model.xfsl = decimal.Parse(dt.Rows[n]["xfsl"].ToString()); } if (dt.Rows[n]["jjdj"] != null && dt.Rows[n]["jjdj"].ToString() != "") { model.jjdj = decimal.Parse(dt.Rows[n]["jjdj"].ToString()); } if (dt.Rows[n]["Total_cb"] != null && dt.Rows[n]["Total_cb"].ToString() != "") { model.Total_cb = decimal.Parse(dt.Rows[n]["Total_cb"].ToString()); } if (dt.Rows[n]["xfmx"] != null && dt.Rows[n]["xfmx"].ToString() != "") { model.xfmx = dt.Rows[n]["xfmx"].ToString(); } if (dt.Rows[n]["mxbh"] != null && dt.Rows[n]["mxbh"].ToString() != "") { model.mxbh = dt.Rows[n]["mxbh"].ToString(); } if (dt.Rows[n]["id"] != null && dt.Rows[n]["id"].ToString() != "") { model.id = int.Parse(dt.Rows[n]["id"].ToString()); } if (dt.Rows[n]["yydh"] != null && dt.Rows[n]["yydh"].ToString() != "") { model.yydh = dt.Rows[n]["yydh"].ToString(); } if (dt.Rows[n]["qymc"] != null && dt.Rows[n]["qymc"].ToString() != "") { model.qymc = dt.Rows[n]["qymc"].ToString(); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Hotel_app.Model.View_Xxfmx_lk model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Hotel_app.Model.View_Xxfmx_lk model) { return(dal.Add(model)); }