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

            if (rowsCount > 0)
            {
                Hotel_app.Model.X_yw_xfmx model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hotel_app.Model.X_yw_xfmx();
                    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]["language_bh"] != null && dt.Rows[n]["language_bh"].ToString() != "")
                    {
                        model.language_bh = dt.Rows[n]["language_bh"].ToString();
                    }
                    if (dt.Rows[n]["language_type"] != null && dt.Rows[n]["language_type"].ToString() != "")
                    {
                        model.language_type = dt.Rows[n]["language_type"].ToString();
                    }
                    if (dt.Rows[n]["xfmx_china"] != null && dt.Rows[n]["xfmx_china"].ToString() != "")
                    {
                        model.xfmx_china = dt.Rows[n]["xfmx_china"].ToString();
                    }
                    if (dt.Rows[n]["xfmx_yw"] != null && dt.Rows[n]["xfmx_yw"].ToString() != "")
                    {
                        model.xfmx_yw = dt.Rows[n]["xfmx_yw"].ToString();
                    }
                    if (dt.Rows[n]["rx"] != null && dt.Rows[n]["rx"].ToString() != "")
                    {
                        model.rx = dt.Rows[n]["rx"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hotel_app.Model.X_yw_xfmx model)
 {
     return(dal.Update(model));
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Hotel_app.Model.X_yw_xfmx model)
 {
     return(dal.Add(model));
 }