public rest_time_row IsUpdate(string machine_code, string start_time, string end_time)
        {
            try
            {
                rest_time_row obj = new rest_time_row();
                string        sql = "select * from fimp.rest_time_row where machine_code='{0}' and start_time<='{1}' and end_time>='{2}'";
                sql = string.Format(sql, machine_code, start_time, start_time);
                obj = PostgreHelper.GetSingleEntity <rest_time_row>(sql);

                if (obj != null)
                {
                }
                else
                {
                    sql = "select * from fimp.rest_time_row where machine_code='{0}' and start_time<='{1}' and end_time>='{2}'";
                    sql = string.Format(sql, machine_code, end_time, end_time);
                    obj = PostgreHelper.GetSingleEntity <rest_time_row>(sql);
                }

                return(obj);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(rest_time_row obj)
 {
     try
     {
         string sql = "Update fimp.rest_time_row set machine_code='{0}',start_time='{1}',end_time='{2}',tag_code='{3}',remarks=N'{4}' where id={5}";
         sql = string.Format(sql, obj.machine_code, obj.start_time, obj.end_time, obj.tag_code, obj.remarks, obj.id);
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public int Insert(rest_time_row obj)
 {
     try
     {
         string sql = "insert into fimp.rest_time_row(machine_code,start_time,end_time,tag_code,remarks)values('{0}','{1}','{2}','{3}',N'{4}')";
         sql = string.Format(sql, obj.machine_code, obj.start_time, obj.end_time, obj.tag_code, obj.remarks);
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public rest_time_row SelectSingle(string machine_code, string ts)
 {
     try
     {
         rest_time_row obj = new rest_time_row();
         string        sql = "select * from fimp.rest_time_row where machine_code='{0}' and start_time<='{1}' and end_time>='{2}'";
         sql = string.Format(sql, machine_code, ts, ts);
         obj = PostgreHelper.GetSingleEntity <rest_time_row>(sql);
         return(obj);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #5
0
        public rest_time_row IsUpdate(string machine_code, string start_time, string end_time)
        {
            rest_time_row obj = RTRS.IsUpdate(machine_code, start_time, end_time);

            return(obj);
        }
예제 #6
0
        public rest_time_row SelectSingle(string machine_code, string ts)
        {
            rest_time_row obj = RTRS.SelectSingle(machine_code, ts);

            return(obj);
        }
예제 #7
0
        public int Update(rest_time_row obj)
        {
            int count = RTRS.Update(obj);

            return(count);
        }
예제 #8
0
        public int Insert(rest_time_row obj)
        {
            int count = RTRS.Insert(obj);

            return(count);
        }