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

            if (rowsCount > 0)
            {
                Tunnel.Model.Tunnel_KaoQinCheck model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Tunnel.Model.Tunnel_KaoQinCheck();
                    if (dt.Rows[n]["s_id"].ToString() != "")
                    {
                        model.s_id = int.Parse(dt.Rows[n]["s_id"].ToString());
                    }
                    if (dt.Rows[n]["s_year"].ToString() != "")
                    {
                        model.s_year = int.Parse(dt.Rows[n]["s_year"].ToString());
                    }
                    if (dt.Rows[n]["s_moon"].ToString() != "")
                    {
                        model.s_moon = int.Parse(dt.Rows[n]["s_moon"].ToString());
                    }
                    if (dt.Rows[n]["s_bid"].ToString() != "")
                    {
                        model.s_bid = int.Parse(dt.Rows[n]["s_bid"].ToString());
                    }
                    model.s_bname = dt.Rows[n]["s_bname"].ToString();
                    if (dt.Rows[n]["s_uid"].ToString() != "")
                    {
                        model.s_uid = int.Parse(dt.Rows[n]["s_uid"].ToString());
                    }
                    if (dt.Rows[n]["s_date"].ToString() != "")
                    {
                        model.s_date = DateTime.Parse(dt.Rows[n]["s_date"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Tunnel.Model.Tunnel_KaoQinCheck model)
 {
     dal.Update(model);
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Tunnel.Model.Tunnel_KaoQinCheck model)
 {
     return(dal.Add(model));
 }