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

            if (rowsCount > 0)
            {
                HM.Model.Qm.Tb_Qm_Point model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model             = new HM.Model.Qm.Tb_Qm_Point();
                    model.Id          = dt.Rows[n]["Id"].ToString();
                    model.ProjectName = dt.Rows[n]["ProjectName"].ToString();
                    model.ProjectCode = dt.Rows[n]["ProjectCode"].ToString();
                    model.PointName   = dt.Rows[n]["PointName"].ToString();
                    model.PointCode   = dt.Rows[n]["PointCode"].ToString();
                    model.Addr        = dt.Rows[n]["Addr"].ToString();
                    model.Map         = dt.Rows[n]["Map"].ToString();
                    model.QRCodesPath = dt.Rows[n]["QRCodesPath"].ToString();
                    model.Remark      = dt.Rows[n]["Remark"].ToString();
                    if (dt.Rows[n]["Sort"].ToString() != "")
                    {
                        model.Sort = int.Parse(dt.Rows[n]["Sort"].ToString());
                    }
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(HM.Model.Qm.Tb_Qm_Point model)
 {
     dal.Update(model);
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(HM.Model.Qm.Tb_Qm_Point model)
 {
     dal.Add(model);
 }