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

            if (rowsCount > 0)
            {
                jdgl_res_head_app.Model.Ssyxfmx_xsy model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new jdgl_res_head_app.Model.Ssyxfmx_xsy();
                    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]["xsy"] != null && dt.Rows[n]["xsy"].ToString() != "")
                    {
                        model.xsy = dt.Rows[n]["xsy"].ToString();
                    }
                    if (dt.Rows[n]["shsc"] != null && dt.Rows[n]["shsc"].ToString() != "")
                    {
                        if ((dt.Rows[n]["shsc"].ToString() == "1") || (dt.Rows[n]["shsc"].ToString().ToLower() == "true"))
                        {
                            model.shsc = true;
                        }
                        else
                        {
                            model.shsc = false;
                        }
                    }
                    if (dt.Rows[n]["xsy_sl"] != null && dt.Rows[n]["xsy_sl"].ToString() != "")
                    {
                        model.xsy_sl = int.Parse(dt.Rows[n]["xsy_sl"].ToString());
                    }
                    if (dt.Rows[n]["id_app"] != null && dt.Rows[n]["id_app"].ToString() != "")
                    {
                        model.id_app = dt.Rows[n]["id_app"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(jdgl_res_head_app.Model.Ssyxfmx_xsy model)
 {
     return(dal.Update(model));
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(jdgl_res_head_app.Model.Ssyxfmx_xsy model)
 {
     return(dal.Add(model));
 }