示例#1
0
 public bool Update(T entity)
 {
     using (var connection = new SqlConnection(_connectionString))
     {
         return(connection.Update(entity));
     }
 }
 public void UpdateShuttle(Shuttle shuttle)
 {
     using (var conn = new SqlConnection(conStr))
     {
         conn.Open();
         conn.Update <Shuttle>(shuttle);
         conn.Close();
     }
 }
示例#3
0
 public void UpdateOrderDetail(OrderDetail orderDetail)
 {
     using (var conn = new SqlConnection(conStr))
     {
         conn.Open();
         conn.Update <OrderDetail>(orderDetail);
         conn.Close();
     }
 }
 public void UpdateTask(MachineTask task)
 {
     using (var conn = new SqlConnection(conStr))
     {
         conn.Open();
         conn.Update <MachineTask>(task);
         conn.Close();
     }
 }
示例#5
0
 public void UpdateLastAddress(Asrs asrs)
 {
     using (var conn = new SqlConnection(conStr))
     {
         conn.Open();
         conn.Update <Asrs>(asrs);
         conn.Close();
     }
 }
示例#6
0
 public void UpdateOrderDetailPallet(OrderDetailPallet orderDetailPallet)
 {
     using (var conn = new SqlConnection(conStr))
     {
         conn.Open();
         conn.Update <OrderDetailPallet>(orderDetailPallet);
         conn.Close();
     }
 }
示例#7
0
        public bool UpdateProductQuantityPlace(ProductQuantityPlace pqp)
        {
            bool done;

            using (var conn = new SqlConnection(conStr))
            {
                conn.Open();
                done = conn.Update(pqp);
                conn.Close();
            }
            return(done);
        }
示例#8
0
        public bool UpdatePalletsAtAddress(PalletsAtAddress palletsAtAddress)
        {
            bool done;

            using (var conn = new SqlConnection(conStr))
            {
                conn.Open();
                done = conn.Update(palletsAtAddress);
                conn.Close();
            }
            return(done);
        }
示例#9
0
        public bool UpdatePalletsAtAddressById(int id)
        {
            PalletsAtAddress palletsAtAddress = GetPalletsAtAddressById(id);

            bool done;

            using (var conn = new SqlConnection(conStr))
            {
                conn.Open();
                done = conn.Update(palletsAtAddress);
                conn.Close();
            }
            return(done);
        }
 public bool Update(T entity)
 {
     try
     {
         using (var connection = new SqlConnection(_connectionString))
         {
             return(connection.Update(entity));
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
        public bool UpdateMachineTaskWithPlcCompletedById(int id)
        {
            var machineTask = GetMachineTaskById(id);

            machineTask.IsCompleted = true;
            machineTask.EndTime     = DateTime.Now;
            bool done;

            using (var conn = new SqlConnection(conStr))
            {
                conn.Open();
                done = conn.Update <MachineTask>(machineTask);
                conn.Close();
            }

            return(done);
        }
示例#12
0
        public bool UpdatePalletsAtAddressWithRelease(string barcode)
        {
            var palletataddress = GetPalletsAtAddressByPaletteBarcode(barcode);

            palletataddress.ReleaseDate   = DateTime.Now;
            palletataddress.ReleaseReason = "ORDER";//TODO:set reason with enum by task data
            palletataddress.IsInside      = false;

            bool done;

            using (var conn = new SqlConnection(conStr))
            {
                conn.Open();
                done = conn.Update(palletataddress);
                conn.Close();
            }
            return(done);
        }
        public bool UpdateBufferWithPalette(MachineTask completedMachineTask)
        {
            log.Debug($"UpdateBufferWithPalette, completedMachineTask.TargetAddress: {completedMachineTask.TargetAddress}");

            Buffer buffer = GetBufferByCode(completedMachineTask.TargetAddress); //load

            buffer.IsEmpty         = false;
            buffer.LastPaletteInfo = completedMachineTask.LoadInfo;

            bool done;

            using (var conn = new SqlConnection(conStr))
            {
                conn.Open();
                done = conn.Update(buffer);
                conn.Close();
            }
            return(done);
        }
示例#14
0
        public int Update <T>(T entity, string connectionString)
        {
            using (IDbConnection connection = new SqlConnection(connectionString))
            {
                if (connection.State != ConnectionState.Open)
                {
                    connection.Open();
                }

                try
                {
                    return(connection.Update <T>(entity));
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }