Beispiel #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Hotel_app.Model.Yxydw_jfbl> DataTableToList(DataTable dt)
        {
            List <Hotel_app.Model.Yxydw_jfbl> modelList = new List <Hotel_app.Model.Yxydw_jfbl>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Hotel_app.Model.Yxydw_jfbl model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hotel_app.Model.Yxydw_jfbl();
                    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();
                    }
                    if (dt.Rows[n]["krly"] != null && dt.Rows[n]["krly"].ToString() != "")
                    {
                        model.krly = dt.Rows[n]["krly"].ToString();
                    }
                    if (dt.Rows[n]["fd_sl"] != null && dt.Rows[n]["fd_sl"].ToString() != "")
                    {
                        model.fd_sl = decimal.Parse(dt.Rows[n]["fd_sl"].ToString());
                    }
                    if (dt.Rows[n]["bl"] != null && dt.Rows[n]["bl"].ToString() != "")
                    {
                        model.bl = decimal.Parse(dt.Rows[n]["bl"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hotel_app.Model.Yxydw_jfbl model)
 {
     return(dal.Update(model));
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Hotel_app.Model.Yxydw_jfbl model)
 {
     return(dal.Add(model));
 }