示例#1
0
 public SupplyAssemblyOrder(string name, DateTime createdAt, SupplyAssemblyOrderStatus status, Supplier supplier)
 {
     this.name      = name;
     this.createdAt = createdAt;
     this.status    = status;
     this.supplier  = supplier;
 }
        private void updateRow()
        {
            if (dataGridView1.CurrentRow == null)
            {
                button1.Enabled = false;
                button2.Enabled = false;
                button5.Enabled = false;
                return;
            }
            SupplyAssemblyOrderStatus status = (SupplyAssemblyOrderStatus)Enum.Parse(typeof(SupplyAssemblyOrderStatus), dataGridView1.CurrentRow.Cells["Статус"].Value.ToString());

            if (status != SupplyAssemblyOrderStatus.CREATED)
            {
                button1.Enabled = false;
                button2.Enabled = false;
            }
            else
            {
                button1.Enabled = true;
                button2.Enabled = true;
            }
            if (status != SupplyAssemblyOrderStatus.ACCEPT)
            {
                button5.Enabled = false;
            }
            else
            {
                button5.Enabled = true;
            }
        }
        public void updateStatusSupplyAssemblyOrders(int id, SupplyAssemblyOrderStatus status)
        {
            SqlCommand command = DataService.createSqlCommand(UPDATE_STATUS_INACCESSIBLE_SUPPLY_ASSEMBLY_ORDER);

            DataService.addParameter("@status", status.ToString());
            DataService.addParameter("@id", id);
            command.ExecuteNonQuery();
        }
        public void updateStatusAndDeliveredAtSupplyAssemblyOrders(int id, SupplyAssemblyOrderStatus status, DateTime deliveredAt)
        {
            SqlCommand command = DataService.createSqlCommand(UPDATE_STATUS_AND_DELIVERED_AT_INACCESSIBLE_SUPPLY_ASSEMBLY_ORDER);

            DataService.addParameter("@status", status.ToString());
            DataService.addParameter("@delivered_at", deliveredAt);
            DataService.addParameter("@id", id);
            command.ExecuteNonQuery();
        }