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

            if (rowsCount > 0)
            {
                MobileSoft.Model.Sys.Tb_Sys_TakePicSecRoomState model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.Sys.Tb_Sys_TakePicSecRoomState();
                    //model.StatID=dt.Rows[n]["StatID"].ToString();
                    if (dt.Rows[n]["StatType"].ToString() != "")
                    {
                        model.StatType = int.Parse(dt.Rows[n]["StatType"].ToString());
                    }
                    if (dt.Rows[n]["CommID"].ToString() != "")
                    {
                        model.CommID = int.Parse(dt.Rows[n]["CommID"].ToString());
                    }
                    model.OrganCode = dt.Rows[n]["OrganCode"].ToString();
                    if (dt.Rows[n]["StatDate"].ToString() != "")
                    {
                        model.StatDate = DateTime.Parse(dt.Rows[n]["StatDate"].ToString());
                    }
                    if (dt.Rows[n]["RoomState"].ToString() != "")
                    {
                        model.RoomState = int.Parse(dt.Rows[n]["RoomState"].ToString());
                    }
                    if (dt.Rows[n]["Counts"].ToString() != "")
                    {
                        model.Counts = int.Parse(dt.Rows[n]["Counts"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.Sys.Tb_Sys_TakePicSecRoomState model)
 {
     dal.Update(model);
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(MobileSoft.Model.Sys.Tb_Sys_TakePicSecRoomState model)
 {
     return(dal.Add(model));
 }