Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <jdgl_res_head_service.Model.Web_skyd_qxyd> DataTableToList(DataTable dt)
        {
            List <jdgl_res_head_service.Model.Web_skyd_qxyd> modelList = new List <jdgl_res_head_service.Model.Web_skyd_qxyd>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                jdgl_res_head_service.Model.Web_skyd_qxyd model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new jdgl_res_head_service.Model.Web_skyd_qxyd();
                    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]["lsbh"] != null && dt.Rows[n]["lsbh"].ToString() != "")
                    {
                        model.lsbh = dt.Rows[n]["lsbh"].ToString();
                    }
                    if (dt.Rows[n]["ddbh"] != null && dt.Rows[n]["ddbh"].ToString() != "")
                    {
                        model.ddbh = dt.Rows[n]["ddbh"].ToString();
                    }
                    if (dt.Rows[n]["sfqr"] != null && dt.Rows[n]["sfqr"].ToString() != "")
                    {
                        model.sfqr = int.Parse(dt.Rows[n]["sfqr"].ToString());
                    }
                    if (dt.Rows[n]["qxsj"] != null && dt.Rows[n]["qxsj"].ToString() != "")
                    {
                        model.qxsj = DateTime.Parse(dt.Rows[n]["qxsj"].ToString());
                    }
                    if (dt.Rows[n]["qxyy"] != null && dt.Rows[n]["qxyy"].ToString() != "")
                    {
                        model.qxyy = dt.Rows[n]["qxyy"].ToString();
                    }
                    if (dt.Rows[n]["sktt"] != null && dt.Rows[n]["sktt"].ToString() != "")
                    {
                        model.sktt = dt.Rows[n]["sktt"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(jdgl_res_head_service.Model.Web_skyd_qxyd model)
 {
     return(dal.Update(model));
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(jdgl_res_head_service.Model.Web_skyd_qxyd model)
 {
     return(dal.Add(model));
 }