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

            if (rowsCount > 0)
            {
                HM.Model.Eq.Tb_EQ_EquipmentFile model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model          = new HM.Model.Eq.Tb_EQ_EquipmentFile();
                    model.Id       = dt.Rows[n]["Id"].ToString();
                    model.EquiId   = dt.Rows[n]["EquiId"].ToString();
                    model.FileName = dt.Rows[n]["FileName"].ToString();
                    model.Fix      = dt.Rows[n]["Fix"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    model.FilePath  = dt.Rows[n]["FilePath"].ToString();
                    model.PhoneName = dt.Rows[n]["PhoneName"].ToString();
                    if (dt.Rows[n]["PhotoTime"].ToString() != "")
                    {
                        model.PhotoTime = DateTime.Parse(dt.Rows[n]["PhotoTime"].ToString());
                    }
                    model.PhotoPId = dt.Rows[n]["PhotoPId"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(HM.Model.Eq.Tb_EQ_EquipmentFile model)
 {
     dal.Update(model);
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(HM.Model.Eq.Tb_EQ_EquipmentFile model)
 {
     dal.Add(model);
 }