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

            if (rowsCount > 0)
            {
                Hotel_app.Model.View_Xxfmx_zb model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hotel_app.Model.View_Xxfmx_zb();
                    if (dt.Rows[n]["mxbh"] != null && dt.Rows[n]["mxbh"].ToString() != "")
                    {
                        model.mxbh = dt.Rows[n]["mxbh"].ToString();
                    }
                    if (dt.Rows[n]["zb_sl"] != null && dt.Rows[n]["zb_sl"].ToString() != "")
                    {
                        model.zb_sl = decimal.Parse(dt.Rows[n]["zb_sl"].ToString());
                    }
                    if (dt.Rows[n]["zb_sj"] != null && dt.Rows[n]["zb_sj"].ToString() != "")
                    {
                        model.zb_sj = DateTime.Parse(dt.Rows[n]["zb_sj"].ToString());
                    }
                    if (dt.Rows[n]["zb_jjje"] != null && dt.Rows[n]["zb_jjje"].ToString() != "")
                    {
                        model.zb_jjje = decimal.Parse(dt.Rows[n]["zb_jjje"].ToString());
                    }
                    if (dt.Rows[n]["zb_Total_cb"] != null && dt.Rows[n]["zb_Total_cb"].ToString() != "")
                    {
                        model.zb_Total_cb = decimal.Parse(dt.Rows[n]["zb_Total_cb"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hotel_app.Model.View_Xxfmx_zb model)
 {
     return(dal.Update(model));
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Hotel_app.Model.View_Xxfmx_zb model)
 {
     return(dal.Add(model));
 }