func (VS *Server) addServiceTypeToDatabase(c *gin.Context, i ServiceType, class string, method string, operation string) bool {
	var item []Item
	VS.DataBase.Find(&item, bolthold.Where("Name").Eq(i.Name).And("ID").Eq(i.ID))
	if len(item) != 0 {
		if item[0].ID == i.ID {
			err := VS.DataBase.Upsert(i.ID, i)
			VS.checkOperation(c, class, method, operation, err)
			return true
		}
		return false
	}
	err := VS.DataBase.Upsert(i.ID, i)
	VS.checkOperation(c, class, method, operation, err)
	return true
}
// This method adds (or updates) the ServiceType created to the Database
// Returns true if the operatios was successfully and false if it fails
This method adds (or updates) the ServiceType created to the Database
Returns true if the operatios was successfully and false if it fails
// This method adds ( or updates ) the ServiceType created to the Database // Returns true if the operatios was successfully and false if it fails
func (VS *Server) addServiceTypeToDatabase(c *gin.Context, i ServiceType, class string, method string, operation string) bool {
	var item []Item
	VS.DataBase.Find(&item, bolthold.Where("Name").Eq(i.Name).And("ID").Eq(i.ID))
	if len(item) != 0 {
		if item[0].ID == i.ID {
			err := VS.DataBase.Upsert(i.ID, i)
			VS.checkOperation(c, class, method, operation, err)
			return true
		}
		return false
	}
	err := VS.DataBase.Upsert(i.ID, i)
	VS.checkOperation(c, class, method, operation, err)
	return true
}
func ( VS * Server ) addServiceTypeToDatabase ( c * gin . Context , i ServiceType , class string , method string , operation string ) bool { var item [ ] Item VS . DataBase . Find ( & item , bolthold . Where ( " " ) . Eq ( i . Name ) . And ( " " ) . Eq ( i . ID ) ) if len ( item ) != 0 { if item [ 0 ] . ID == i . ID { err := VS . DataBase . Upsert ( i . ID , i ) VS . checkOperation ( c , class , method , operation , err ) return true } return false } err := VS . DataBase . Upsert ( i . ID , i ) VS . checkOperation ( c , class , method , operation , err ) return true }
This method adds (or updates) the ServiceType created to the Database
Returns true if the operatios was successfully and false if it fails
This method adds ( or updates ) the ServiceType created to the Database Returns true if the operatios was successfully and false if it fails