func (VS *Server) editServiceOrder(c *gin.Context) {
	service, b := VS.getOurService(c, "h_records", "editServiceOrder", "service, b := VS.getOurService")
	if !b {
		return
	}
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	oldServiceOrder := VS.getServiceOrderByID(c, id, "h_records", "editServiceOrder", "oldServiceOrder := VS.getServiceOrderByID")
	newServiceOrder, b := VS.getNewServiceOrder(c, id)
	if !b {
		return
	}
	oldServiceOrder.Assigned = newServiceOrder.Assigned
	idservicetype, b := VS.getIDParamFromURL(c, "idservicetype")
	if !b {
		return
	}

	// Audit
	audit := VS.getAudit(c, newServiceOrder, id, service.ID, Modified)
	modified := VS.dynamicAuditChange(c, newServiceOrder, oldServiceOrder, audit.ID)
	// Changes
	if oldServiceOrder.IDService != newServiceOrder.IDService {
		wkA := VS.getServiceByID(c, oldServiceOrder.IDService, "h_records", "editServiceOrder", "wkA := VS.getServiceByID(c, oldServiceOrder.ServiceID", true)
		wkB := VS.getServiceByID(c, newServiceOrder.IDService, "h_records", "editServiceOrder", "wkB := VS.getServiceByID", true)
		VS.checkChange(c, audit.ID, "Workshop", wkA.Name, wkB.Name)
		modified = true
	}
	if oldServiceOrder.IDService != newServiceOrder.IDService {
		proA, _ := VS.getVideoCourseByID(c, oldServiceOrder.IDService, "h_records", "editServiceOrder", "proA, _ := VS.getVideoCourseByID", true)
		proB, _ := VS.getVideoCourseByID(c, newServiceOrder.IDService, "h_records", "editServiceOrder", "proB, _ := VS.getVideoCourseByID", true)
		VS.checkChange(c, audit.ID, "Name", proA.Name, proB.Name)
		modified = true
	}
	if modified {
		VS.editElementInDatabaseWithRegister(c, newServiceOrder, oldServiceOrder, newServiceOrder.ID, service.ID, "h_records", "editServiceOrder", "VS.addElementToDatabase")
	}
	VS.goodFeedback(c, "/records/service-orders/"+idservicetype.Hex())
}
// Modifies the ServiceOrder into the Database
Modifies the ServiceOrder into the Database
// Modifies the ServiceOrder into the Database
func (VS *Server) editServiceOrder(c *gin.Context) {
	service, b := VS.getOurService(c, "h_records", "editServiceOrder", "service, b := VS.getOurService")
	if !b {
		return
	}
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	oldServiceOrder := VS.getServiceOrderByID(c, id, "h_records", "editServiceOrder", "oldServiceOrder := VS.getServiceOrderByID")
	newServiceOrder, b := VS.getNewServiceOrder(c, id)
	if !b {
		return
	}
	oldServiceOrder.Assigned = newServiceOrder.Assigned
	idservicetype, b := VS.getIDParamFromURL(c, "idservicetype")
	if !b {
		return
	}
	audit := VS.getAudit(c, newServiceOrder, id, service.ID, Modified)
	modified := VS.dynamicAuditChange(c, newServiceOrder, oldServiceOrder, audit.ID)
	if oldServiceOrder.IDService != newServiceOrder.IDService {
		wkA := VS.getServiceByID(c, oldServiceOrder.IDService, "h_records", "editServiceOrder", "wkA := VS.getServiceByID(c, oldServiceOrder.ServiceID", true)
		wkB := VS.getServiceByID(c, newServiceOrder.IDService, "h_records", "editServiceOrder", "wkB := VS.getServiceByID", true)
		VS.checkChange(c, audit.ID, "Workshop", wkA.Name, wkB.Name)
		modified = true
	}
	if oldServiceOrder.IDService != newServiceOrder.IDService {
		proA, _ := VS.getVideoCourseByID(c, oldServiceOrder.IDService, "h_records", "editServiceOrder", "proA, _ := VS.getVideoCourseByID", true)
		proB, _ := VS.getVideoCourseByID(c, newServiceOrder.IDService, "h_records", "editServiceOrder", "proB, _ := VS.getVideoCourseByID", true)
		VS.checkChange(c, audit.ID, "Name", proA.Name, proB.Name)
		modified = true
	}
	if modified {
		VS.editElementInDatabaseWithRegister(c, newServiceOrder, oldServiceOrder, newServiceOrder.ID, service.ID, "h_records", "editServiceOrder", "VS.addElementToDatabase")
	}
	VS.goodFeedback(c, "/records/service-orders/"+idservicetype.Hex())
}
func ( VS * Server ) editServiceOrder ( c * gin . Context ) { service , b := VS . getOurService ( c , " " , " " , " " ) if ! b { return } id , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } oldServiceOrder := VS . getServiceOrderByID ( c , id , " " , " " , " " ) newServiceOrder , b := VS . getNewServiceOrder ( c , id ) if ! b { return } oldServiceOrder . Assigned = newServiceOrder . Assigned idservicetype , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } audit := VS . getAudit ( c , newServiceOrder , id , service . ID , Modified ) modified := VS . dynamicAuditChange ( c , newServiceOrder , oldServiceOrder , audit . ID ) if oldServiceOrder . IDService != newServiceOrder . IDService { wkA := VS . getServiceByID ( c , oldServiceOrder . IDService , " " , " " , " " , true ) wkB := VS . getServiceByID ( c , newServiceOrder . IDService , " " , " " , " " , true ) VS . checkChange ( c , audit . ID , " " , wkA . Name , wkB . Name ) modified = true } if oldServiceOrder . IDService != newServiceOrder . IDService { proA , _ := VS . getVideoCourseByID ( c , oldServiceOrder . IDService , " " , " " , " " , true ) proB , _ := VS . getVideoCourseByID ( c , newServiceOrder . IDService , " " , " " , " " , true ) VS . checkChange ( c , audit . ID , " " , proA . Name , proB . Name ) modified = true } if modified { VS . editElementInDatabaseWithRegister ( c , newServiceOrder , oldServiceOrder , newServiceOrder . ID , service . ID , " " , " " , " " ) } VS . goodFeedback ( c , " " + idservicetype . Hex ( ) ) }
Modifies the ServiceOrder into the Database
Modifies the ServiceOrder into the Database
// Audit // Changes