/// <summary>
        /// 插入
        /// </summary>
        /// <param name="data"></param>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public int insertTimeAttendance_AttendanceInformation_machineDal(TimeAttendance_AttendanceInformation_machine data, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[]
            {
                new SqlParameter("@MachineID", SqlDbType.VarChar, 50)
                {
                    Value = data.MachineID
                },
                new SqlParameter("@ComInterface", SqlDbType.VarChar, 50)
                {
                    Value = data.ComInterface
                },
                new SqlParameter("@BaudRate", SqlDbType.VarChar, 50)
                {
                    Value = data.BaudRate
                },
                new SqlParameter("@IPAddress", SqlDbType.VarChar, 50)
                {
                    Value = data.IPAddress
                },
                new SqlParameter("@MachinePosition", SqlDbType.VarChar, 80)
                {
                    Value = data.MachinePosition
                },
                new SqlParameter("@MachineUse", SqlDbType.VarChar, 50)
                {
                    Value = data.MachineUse
                },
            };

            return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms));
        }
        private void btn_ClearData_Click(object sender, EventArgs e)
        {
            if (dataList.Count <= 0)
            {
                MessageBox.Show("无获取数据的机器,请添加!");
                return;
            }

            TimeAttendance_AttendanceInformation_machine data = dataList[dataGridViewX1.CurrentRow.Index];

            if (data == null)
            {
                return;
            }
            if (axCZKEM1.Connect_Net(data.IPAddress, 4370))
            {
                if (MessageBox.Show("是否删除此机器内的考勤记录?", "系统提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    G.Setlb_QueryState("正在删除...");
                    if (axCZKEM1.ClearGLog(Convert.ToInt32(data.MachineID)))
                    {
                        G.Setlb_QueryState("完成");
                    }
                    else
                    {
                        MessageBox.Show("删除失败");
                    }
                }
            }
        }
 /// <summary>
 /// 新增
 /// </summary>
 /// <param name="data"></param>
 /// <param name="SQLCommand"></param>
 /// <returns></returns>
 public bool insertTimeAttendance_AttendanceInformation_machineBll(TimeAttendance_AttendanceInformation_machine data, string SQLCommand)
 {
     if (taid.insertTimeAttendance_AttendanceInformation_machineDal(data, SQLCommand) > 0)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
        void SetDataGridView(TimeAttendance_AttendanceInformation_machine data)
        {
            if (data == null)
            {
                return;
            }

            txt_MachineCoding.Text = data.MachineID;
            txt_IPAddress.Text     = data.IPAddress;
            txt_BaudRate.Text      = data.BaudRate;
            com_COMmouth.Text      = data.ComInterface;
            com_machine.Text       = data.MachinePosition;
            com_MachineUse.Text    = data.MachineUse;
        }
        TimeAttendance_AttendanceInformation_machine GetTimeAttendance_AttendanceInformation_machine()
        {
            TimeAttendance_AttendanceInformation_machine tai = new TimeAttendance_AttendanceInformation_machine()
            {
                MachineID       = txt_MachineCoding.Text.Trim(),
                BaudRate        = txt_BaudRate.Text.Trim(),
                IPAddress       = txt_IPAddress.Text.Trim(),
                ComInterface    = com_COMmouth.Text.Trim(),
                MachinePosition = com_machine.Text.Trim(),
                MachineUse      = com_MachineUse.Text.Trim()
            };

            return(tai);
        }