Beispiel #1
0
        /// <summary>
        /// 查询时间是否在休息时间列表中
        /// </summary>
        /// <param name="time">时间</param>
        /// <returns></returns>
        public bool SelectCount(string time, string unit_no)
        {
            try
            {
                bool   result = false;
                string sql    = "select * from fimp.rest_time where start_time<='{0}' and end_time>='{1}' and unit_no='{2}' and state='A'";
                sql = string.Format(sql, time, time, unit_no);
                rest_time obj = PostgreHelper.GetSingleEntity <rest_time>(sql);

                if (obj != null)
                {
                    result = true;
                }
                else
                {
                    result = false;
                }

                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(rest_time obj)
 {
     try
     {
         string sql = "update fimp.rest_time set start_time='{0}',end_time='{1}',unit_no='{2}',state='{3}' where id={4}";
         sql = string.Format(sql, obj.start_time, obj.end_time, obj.unit_no, obj.state, obj.id);
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
 /// <summary>
 /// 插入数据
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Insert(rest_time obj)
 {
     try
     {
         string sql = "Insert into fimp.rest_time(start_time,end_time,unit_no,state)values('{0}','{1}','{2}','{3}')";
         sql = string.Format(sql, obj.start_time, obj.end_time, obj.unit_no, obj.state);
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #4
0
 public rest_time SelectTime(string unit_no)
 {
     try
     {
         string sql = "select * from fimp.rest_time where unit_no={0}";
         sql = string.Format(sql, unit_no);
         rest_time obj = new rest_time();
         obj = PostgreHelper.GetSingleEntity <rest_time>(sql);
         return(obj);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #5
0
        public rest_time SelectTime(string unit_no)
        {
            rest_time obj = RTS.SelectTime(unit_no);

            return(obj);
        }
Beispiel #6
0
        public int Update(rest_time obj)
        {
            int count = RTS.Update(obj);

            return(count);
        }
Beispiel #7
0
        public int Insert(rest_time obj)
        {
            int count = RTS.Insert(obj);

            return(count);
        }
Beispiel #8
0
        public rest_time SelectSingle(int id)
        {
            rest_time obj = RTS.SelectSingle(id);

            return(obj);
        }