示例#1
0
        public void UpdateMonitorMotor(MonitorMotorInfo info)
        {
            string endDate = string.Empty;

            if (info.EndDate.HasValue)
            {
                endDate = "'" + info.EndDate.ToString() + "'";
            }
            else
            {
                endDate = "null";
            }
            string sql = "update Rent_Motor_Monitor set MotorNO='" + info.MotorNO + "',StartDate='" + info.StartDate.ToString() + "',EndDate=" + endDate + ",MotorType='" + info.MotorType + "',Status='" + info.Status + "' where ID='" + info.ID + "'";

            MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
        }
示例#2
0
        public void AddMonitorMotor(MonitorMotorInfo info)
        {
            string endDate = string.Empty;

            if (info.EndDate.HasValue)
            {
                endDate = "'" + info.EndDate.ToString() + "'";
            }
            else
            {
                endDate = "null";
            }
            string sql = "insert into Rent_Motor_Monitor values ('" + Guid.NewGuid().ToString() + "','" + info.MotorNO + "','" + info.CreatedOn.ToString() + "','" + info.StartDate.ToString() + "'," + endDate + ",'" + info.CreatedBy + "','" + info.MotorType + "','" + info.Status + "')";

            MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
        }