Exemplo n.º 1
0
        /// <summary>
        /// 获取车辆特定时间的驾驶员
        /// </summary>
        /// <param name="plate"></param>
        /// <param name="date"></param>
        /// <returns></returns>
        public Sys_Users GetCarUser(string plate, DateTime date)
        {
            Sys_Car car = new Sys_Car(plate);
            string  sql = string.Format(" select top 1 * from sys_caruser where CarId={0} and updatetime<'{1}' order by updatetime desc", car.Id, date);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count == 1)
            {
                Sys_Users su = new Sys_Users(DBTool.GetIntFromRow(ds.Tables[0].Rows[0], "UserId", 0));
                return(su);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取车辆当前驾驶员
        /// </summary>
        /// <param name="plate"></param>
        /// <returns></returns>
        public Sys_Users GetCarUser(string plate)
        {
            Sys_Car car = new Sys_Car(plate);

            return(GetCarUser(car.Id));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 更换车辆
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="carId"></param>
        /// <returns></returns>
        public bool ChangeCar(int userId, string CarPlate)
        {
            Sys_Car car = new Sys_Car(CarPlate);

            return(ChangeCar(userId, car.Id));
        }