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

            if (rowsCount > 0)
            {
                Common.Model.MouldingMachineEvent_Model model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model              = new Common.Model.MouldingMachineEvent_Model();
                    model.MachineID    = dt.Rows[n]["MachineID"].ToString();
                    model.PQMmachineID = dt.Rows[n]["PQMmachineID"].ToString();
                    model.Event_Type   = dt.Rows[n]["Event_Type"].ToString();
                    model.error_code   = dt.Rows[n]["error_code"].ToString();
                    model.error_name   = dt.Rows[n]["error_name"].ToString();
                    if (dt.Rows[n]["event_time"].ToString() != "")
                    {
                        model.event_time = DateTime.Parse(dt.Rows[n]["event_time"].ToString());
                    }
                    model.remarks = dt.Rows[n]["remarks"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Example #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Common.Model.MouldingMachineEvent_Model model)
 {
     return(dal.Update(model));
 }
Example #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(Common.Model.MouldingMachineEvent_Model model)
 {
     dal.Add(model);
 }